according to Android Authority, this is a known issue on the 5X. Here is a cut and paste:
This seems to be a problem with the proximity sensor, and is generally faced by users that use generic screen guards, especially of the tempered glass variety. Screen guards made specifically for the Nexus 5X come with an L shaped cut at the top that keep the proximity sensor uncovered, and using this helps avoid the problem.
You can also check if there is a problem with the proximity sensor itself. Download an app like Aida64 from the Google Play Store. Go to the Sensors section and look for the Proximity sensor. Hold your hand over the sensor, and the value should switch between 5 cm and 0 cm for far and near respectively.
A temporary workaround to help end calls, if neither of the above two solutions work, is to Settings – Accessibility, and enable “Power button ends call.”
A rogue app may also be the cause of concern. Boot the device into Safe Mode and see if the issue persists. If it doesn’t, uninstall any apps that you may have downloaded before the problem started, and see if that fixes it.
So it sounds like most likely your prox sensor got misaligned during the repair, was damage or possibly you put a screen guard on that is interfering.
Hope that helps.
Thanks for posting. This solved my problem.
door Ambleside Property LLC