If your switches are wired NC then you may have a bad connection or a break in the cable somewhere. Cable internally fractured seem to be the bane of my life. After homing and doing an eight hour print, my 3D printer would not home for the next print as the cable went OC in with the movement. Easily fixed but a PITA all the same. I advise that cables are routed to give the largest possible radius of curvature where they move and the cable ends are clamped where they meet the switch or motor so they don't move relative to the connection.

Hope this helps,

Rob