I also faced the same issue a month ago, try to clean the proximity sensor with a cotton swab or something. In my case there was some dirt and lint accumulated over the proximity sensor and simply cleaning it resolved the issue. If you are using a tempered glass with black borders, make sure it is not covering the sensor. In case you don't know the location, the proximity sensor is located on top right of the phone between speaker and the notification Led.