I don't think my reading your G code will help, as I do not have a simulator, or know your CNC machine capabilities. All my precision machines are retired from toolrooms, and are manually controlled.
I think you should consider the possible reasons for unpredictable dimension and finish. A hard tool, cutting a hard material, may change the depth of cut as the material surface hardness changes with depth. When tool deflection is similar to the depth of surface hardening, you can expect aggravated variation in the depth of cut.
You might lower the tool cutting edge slightly, to reduce push-back from the work. If the cutting edge is too high, it will rise to, and then burnish the surface, damaging the relief face of the cutter. That plunging path can be initiated cyclically, by interrupted cutting due to eccentric distortion.
Maybe you can release most of the distortion prior to nitriding.
1. Anneal the stock before machining.
2. Machine the first approximation, sufficiently oversized to handle any distortion.
3. Heat soak to the nitriding temperature, allowing the distortion to relax after removing the bulk of the material.
4. Finish machine to approach the final dimensions.
5. Nitriding.
6. Grind to final dimension and finish.