Had the same problem and couldn't solve it. Later I realised that it started to happen after I applied a protective foil on the screen.
I cut off a little piece of the foil so the screen is protected, but the area where the sensor is, is not covered.
Now it works fine again.
The phone just can...