Problem with Z Axis - Suddenly goes too deep mid-project

Couple of things to look at:

https://www.avidcnc.com/support/troubleshooting/mach4ControlsProCnc/zAxis/#z-axis-height-lowers-unexpectedly-during-a-program

There have also been reports of Z axis “drift”

A solution that has helped some users is flipping z direction pin: