Deep spiral pocket resets Z axis each pass

I’m using a 1/4" CNC router table (running Mach3) to cut circular pockets into 3/4" MDF at a final depth of 3/8". I have it set to cut 1/8" deep on each pass with a total of 3 passes. It cuts the first pass perfectly, then senses where the material surface is (the freshly cut pass) and marks that as Z=0. Then it tries to cut the next pass the full 1/4" below this new surface. Instead of cutting at 1/4" and only taking out 1/8", it’s cutting at 3/8" and trying to take out 1/4" of wood. After the pocket, the z-axis is messed up enough that the bit doesn’t clear the workpiece for its rapid move.

How can I get the code to use my Z=0 and not try to sense it before each cut? G code of the pocket (with some other features) is attached.

You are using a plasma post processor for milling/routing. As you discovered this does some odd things. Go to Options->machine->post processor and select the Mach3 post processor.