Hey Tom,
this kind of failure has been reported relatively frequently.
When this happens (like here, here or here) the cause is usually a cable/connector problem on Z stepper motor cable.
Check if all cable connectors for the Z stepper motor sit correctly on all connections between Onefinity CNC Controller and the Z stepper motor.
Then mill air (no workpiece or better no milling bit) to check if you can reproduce the error.