This issue was fixed in InDesign version 16.3 that was released some time back.
Closing this issue.
Adobe InDesign team
An error occurred while saving the commentMichael James commented
This is being tracked as a "to-fix" issue on the adobe bugs list, no timeline on when this will make it out into the wild yet though.
Seems like a big omission in the testing procedure as lots of scripts use this library to manipulate XMPMichael James supported this idea ·