Mach3 isn't doing anything funny, it's doing what the code you feed it tells it to.
In addition to a units command G20/G21 is there a G54 through G59 in there?
Unless you have set your zero in G54 switching to G54 through G59 will lose you your zero.
It's common for people to be operating in your machine's Absolute Co-ordinates without being aware that multiple offsets are available and to be surprised when a G54 throws them a curve ball.