This feels to me like it is a network malfunction, or a hard disk malfunction.
Hmmm not sure. There is a secondary behaviour in so far as once the metadata write has failed in a given Lightroom session, thats pretty much it unless I delete the XMP file and save a new xmp file. However, close that Lightroom session and start a fresh Lightroom session, then select those images again and save/write metadata again, most if not all will write the changes to the xmp files. If any fail, then closing the session and starting Lightroom again and re-saving the metadata changes for the affected images usually succeeds.
Whilst being a pain, keeping a smart collection of 'Metadata Issues' allows me to keep tabs on the failures and re-process the collection whenever I open up Lightroom so that I can stay on top of the problem.
I only discovered this after I posted the above topic, so at least its a useful workaround.....
This still feels to me like a network or hard drive problem, perhaps intermittent. You would be wise to consider that as a possible explanation and investigate.