(Gotta watch using that back button in the browser-- you posted your message 4 times. :P)
What you are doing will work. Well, it should work, and it does work for me. (You _are_ using ExifTool 6.40
or later, right?)
ExifTool will add back the necessary "spots" in the file to write the specified information. One thing though:
Your calls to SetNewGroups() have no effect because you are providing a specific group for writing the information.
The SetNewGroups() only sets the default group priorities if you call SetNewValue() with a group-less tag.
I just tried this code snippet here, and it works fine:
(4)
]
