I think you have a really bad bit of wiring on the Z axis. Stray pulses and even changes of direction are happening. The root cause may be a lack of adequate grounding all around, or maybe just a loose ground wire.
Grounding (or rather inadequate amounts of it) can be the cause of so many ills with a CNC.
Cheers