I experienced this as well on my Ender 3 with OEM ribbon cable. This cable is about 1m (3ft) long.
The X Endstop light glows dimly whenever the stepper motor is holding and the endstop is not closed. Disconnecting the sensor from the ribbon cable does not eliminate, but disconnecting the ribbon cable from the X endstop pins on the board does.
The firmware correctly reads the state. The glow does not appear after turning it on. Engaging/disengaging the endstop has the expected/normal visible effect. Calling X Home causes the glow to begin, while disabling the stepper by calling M18 X eliminates the glow.
I assume it is caused by the length of the adjacent runs as described in an earlier reply here.