I suggest to test a new proximity sensor, the actual one may have its flexible connection cable slightly damaged.
Thank you dear, but i think i finally got it. I know why the sensor is not working correctly.
A you can see in the photo, the sensor has a tiny rubber cover over it which is needed for it to work correctly.
Unfortunately, the sensor in the photo is taken from a youtube video. In fact, my sensor DOES NOT HAVE such rubber cover, which leaves the sensor exposed to the inner part of the screen and prevents it from working correctly.
I suppose the rubber cover was lost in the assembly line because it just wasn't there.
Until now, i had no luck in finding a spare proximity sensor nor a rubber cover, but while I'm looking I had an idea.
Dear Admin... can you provide the specifications of the dimensions of the proximity sensor and/or of the rubber cover?
You see, I have some skills in 3D modeling and have a very precise (down to 0.05mm) 3D Printer which can also print in a rubber-ish material... I can make the piece by myself if it is possible to recover the specifications.
Thank you for all your support.