For the LG G2, the problem is actually pretty simple. Don't install the proximity sensor while it's still on the black retaining bracket. If you leave the sensor in the bracket, and push it down far enough for the bracket to click into place, the rubber gasket prevents the actual sensor from going in as far as it should. So:
Step 1: Remove the sensor flex from the black retention bracket.
Step 2: Install the sensor into the gasket. Now that there's no bracket, you can see it go all the way to the bottom of the rubber gasket.
Step 3: Install the retention bracket.
Step 4: Put the sticky (taped) back part of the flex back onto the bracket.
Step 5: Install logic board and test for functionality.
Ever since I started doing this, I have much less problems with the prox sensors on the G2. There are still occasional problems, but it's usually just because the prox sensors LG put in the G2 are junk, and break easily.