this seems to happen not only on my Mi5 but also on other xiaomi phones: when a phone call is initiated or answered, the screen turns black and you're not able to terminate the call anymore.
this is most likely due to a miscalibration of the proximity sensor. for some reason this sensor seems to lose its calibration or something like that. To verify this, you can simply go to settings→system apps→phone→incoming call settings→proximity sensor and disable it. if this fixes your problem, then you need to recalibrate the proximity sensor in order for it to work properly again. just disabling the sensor is not a good solution as this will certainly lead to you pushing buttons with your ears while in a phone call :)
so make sure you re-enable that proximity sensor after testing.
you need to recalibrate the proximity sensor. open the dialer app and enter
* # * # 64663 # * # * this will then access a configuration menu. scroll down to the
Proximity Sensor test and run it. follow the instructions to calibrate the sensor and then exit the configuration tool and try if that fixed your issue.