This is a feature for most of the smartphones which was implemented so that you don't interfere while the call is active. It's the feature of the gyroscope sensor. Also if you encounter problems with your phone, you should proceed to do Factory Reset. If the problem persists, the phone needs service repairs because it can be a hardware problem.