I have weeks with this problem. In receiving and making calls .moto x second gen . A friend told me about proximity sensor, and may be a app is causing it. I reboot a couple of times. I wonder if I reset it to factory it will help.
it may just be a screen timeout
go to the setting/accessibility and about midway down the list is a power button ends call make sure it turn off then when the screen goes black you can then tap the power button to re wake the screen
If an app is causing the issue, just place the phone in safe mode and test to see if it goes away. If it goes away, then you have app issue.Safe Mode
If you think it may be the proximity sensor, try one of the sensor tester apps. I’ve used Sensors test before. Sensors test - Android Apps on Google Play
Motorola also has a troubleshooting section that you can go through. Motorola Support - Find Answers | Motorola Mobility, Inc.
In addition to the other suggestions you’ve received, sometimes a case or screen protector can interfere with the way the proximity sensor works. If you have either, please remove it and see if the screen continues to go black during calls.