I downloaded a sample RW2 file from this camera and added GPS data. I made sure to embed metadata in the file rather than put it in an XMP sidecar file. After doing this, the raw file was able to open and render in Photoshop and Lightroom without an issue.
In regards to "uncorrupting" the file, Photo Mechanic has the option Revert TIFF-based RAWs to original, which is in the tools menu. Without having the file its hard for me to say, but in the description of the tool it says "If you are experiencing problems with other RAW processing software after embedding IPTC or XMP metadata into TIFF-based RAW photos using Photo Mechanic, this tool will undo any edits and revert the RAW photos to their original state before they were edited with Photo Mechanic." So there's a pretty good chance that Photo Mechanic can already do what you are asking in regards to "undo". It also gives the option to backup the embedded metadata to sidecar XMP so you won't actually lose the metadata you are stripping from the embedded.
Once you do this if it fixes the issue of the image rendering in other software and you can then repeat whichever action corrupts the file and reproduce the issue and then provide me with the exact steps to reproduce the problem, then we can look into a fix.
Please also note which build of Photo Mechanic you are on and what operating system you are using.
Quick edit: Even if you can't reproduce it, a copy of just the damaged file would be great as well, but being able to start with a file straight from the camera would be helpful for us.