Gen 1 BB Controller Z-slider moving in random directions & losing homing/positioning

On a BB controller, this is 100% of the time a bad wire/wire connection.

3a and 3b on this faq will identify which wire(s) and get you fixed up: