Google Pixel phones have been plagued by proximity sensor issues for years.
When you make or receive a call, the screen often stays on.
As a result, you may accidentally activate various options during the call.
Lets see if theres a permanent solution for this issue.
The sensor should start working properly.
Wait a few minutes and then deactivate the option.
Flipping Adaptive Brightness off and back on should solve this issue.
Use a soft cotton cloth and wipe the proximity sensor area under the top speaker.
After cleaning the area with a microfiber cloth, the issue should be gone.
For a permanent solution, go to the next step.
Launch the Google Play Store app, and download the Androsensor and Proximity Sensor Reset apps.
drop in the apps, reboot your phone and verify the two apps are running.
Call someone and verify if the screen turns off as expected.