These kind of issues can be tough to troubleshoot. It's hard to see in the photos how much depth there is to the Z value change. The first photo with the straight line looks like a typical issue where the Z clearance value for a move to a new part location was set too low, but the second photo with the circular error probably rules that out because transfer moves are usually linear. Does this same issue repeat from part to part when using the same machining strategy or does it vary in location and severity?. If the Z discrepancy is random, then it's probably a machine issue - Z axis motor, drive, wiring, controller etc. I had a bad stepper motor on one of my lathes recently that was causing a small random error. I was positive it was a drive or controller problem, but in the end I was wrong and it was a failing motor (ran for too long at too high of a power supply voltage and finally started to fail). The error could also be caused be by some kind of mechanical interference in the Z axis - should be easy to check for that.
Alternatively you can dig through the gcode and try to find the area where the problem occured (dry run in mach4 perhaps), and check the Z values to see if there is an abrupt change that doesn't seem correct.