Sounds like the endstop switch is failing or is being triggered by electrical noise.