2If the diode were connected the other way, it would pass current whenever the proximity switch turned on, shorting past the relay coil and most likely damaging the proximity switch in doing so!