The iPhone screen was probably been replaced by a bad batch. Replacing the proximity fled will not help.
Use a permanent black marker and coloured the digitizer.
Put the iPhone back together "temporary (no screws)" and test the proximity sensitivity. If the LCD still doesn’t switch off during a call then apply more marker.
If it doesn’t light up after a call then scratch the marked spot to shed more light.
FIXSTATION – Australia leading mobile repair.