It sounds like a DNC error, except that you're probably not running this in DNC mode.
I've seen instances myself, where large gcode programs are written to disk with an incorrect character, specifically a carriage return character is substituted for a line feed character. You cannot see these characters in an ordinary text editor, but they exist at the end of every line of text.
The result of this is two lines of code written together as one long command line.
Normally, the machine halts with an error because it cannot interpret such a line correctly, but I don't know if Mach reacts that way, or whether it does something else and keeps on going.
Anyways, some text editors will show you this condition, in that, as you scroll through the code, you will suddenly see two lines run together. Other editors 'autofix' this when the file is sent to the display for you, making the error impossible to see.
I use a hex editor to scan for this type of error, yes the very first one that comes up on Google Its a dandy little tool: Freeware Hex editor XVI32
The search method is to use 'find' to look for a string written in hex as this:
0D 0D
That string is the illegal string, and should never exist because it consists of two carriage returns. All the legitimate lines of text will end with:
0D 0A
which is carriage return and line feed.
So try searching your gcode file using the hex editor for the 0D 0D combination. If you find a few instances, don't be surprised. You can heal them all with search and replace in the hex editor.
BTW, this same error often occurs on large files transferred to a floppy disk. I'd hardly call this a random error, because of the precision of the mistake (it could be any of 255 other characters if it were actually random) so I think it is something to do with Windows interacting with certain hardware.
First you get good, then you get fast. Then grouchiness sets in.
(Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)