What control card are you using? i found many don't implement G31 properly and i had similar problems to what you describe with the "e cut" usb card and also the "XHc" usb motion controller card. With the XHc card the issue was even related to teh number of times you have called G31 it seems, like the first time would work perfect, then the second one, doing the same thing but not having restarted mach 3, would cause the Z axis to go up until it got to +6mm on the dro every time, or until you hit the probe as it ascends as you said.