Hi there.
Just for info: like other, I have randomly some issues with the proximity sensor of my Redmi note 10 PRO.
Even it seems to work find when I have a call, sometime the sensor don't work and specially with Tasker
I test it with CIT (*#*#6484#*#*) and sometimes it work 'till the sensor was blocked.
When thas happens, I move the phone in a more enlightened place and it work again.
With Tasker, there's another oddity.
When the proximity sensor is blocked, I approach my hand to the back of the phone (where there is the camera lens) and it works again as if the sensor move to the back of the phone...
After some trys, it blocked agan and the proximity sensor on the front of the smartphone work again.
very strange