Which machine do you have?
Which Z-axis?
If you install a probing pin (or tool if you don’t have a BitSetter), initialize, jog to the center of motion, and then grab the tip of the pin (or shaft of the tool) and try to shift things what happens? The machine should be rock solid and nothing should move — if anything does move, check on what allows the motion and address it.
Jog down so that the tip of the tool/pin is at the surface of the MDF, jog up 1" — how much does the machine move? If it doesn’t move 1" reconfigure the machine for the correct Z-axis.
If you still have difficulties, please create a simple test file suited to cutting in a piece of scrap:
and then upload that file here, let us know step-by-step how you are securing your stock and setting zero relative to it and managing all tool changes and a photo showing an attempt at cutting still in place on the machine with the machine either at the origin or a specified offset from it and we will work through this with you.