Did you try sending it back to Zero after it happened.? This would tell you if it lost steps as it would go back to the wrong place. Which would be the most likely cause, if not then it's a little worrying because if G-code is fine it means Mach went Awol which shouldn't happpen.!

Thou to be honest I'd be more inclined to say it just lost position thru missed steps maybe due to heavy load with possibly too high feedrate? I'd take a guess and suggest you may have the motors slightly over tuned possibly.?
The fact it cut air fine doesn't mean your motor tuning is Ok. You could just be on the edge with motor tuning but not enough to stall motors but enough to loose steps when under a heavy load and/or too high feedrate.

Post the settings for your motor tuning and give spec of the machine and I'll take a look.