My steppers have built-in plugs and are not very secure so I tacked both sides of them all with hot melt glue. Also I have a lot of 0.1″ connectors hidden in the conduit and I secured them all with electrical tape.
Another thing to watch out for when testing is that an intermittent open circuit like this can be very sensitive to the position of the wire and may open or close at different X/Y positions. So I suggest putting a piece of tape or a sticky note or a sharpie dot on all the pulleys and remove the belts. Then manually tell the steppers to move a large distance and move the axes by hand all over repeatedly. Look for the back-and-forth stuttering that I mentioned on one of the steppers.