I belive in Mach 2 I had this problem with "Home" button where it would move all the axis at once, so the Z would scrap my part while the X and Y moved.
You can fix this by editing the button
Just what Brett said:
-Go to "operator"
-"Edit button Script"
-and press on the button
for "Ref All Home", this will move X, than Y, than Z, than A, and will wait for them to hit home before doing the next axis:
Add this if it's not there:
DoButton( 24 )
DoButton( 23 )
DoButton( 22 )
DoButton( 25 )
Also as Brett said:
check if you're Z Safty is on:
-"Config"
-"safe Z setup"
-Safe Z and Optional "Goto safe Z when Stop Button is hit"