I'm using the latest version of Lightroom Classic (10.1) on Windows 10 but I think I've seen this issue in previous versions as well.
Lightoom provides a "metadata has been changed" flag as a library filter item or when defining a smart collection. When a file has this flag set, I can usually go to Metadata --> Save Metadata to File (Ctrl+S) and it will rewrite the image file and clear the flag. But I am running into a handful of images where this doesn't work. I use Ctrl+S to save the metadata, and alhough I can see the modification time on the file change, the "metadata has been changed" flag remains set for that image.
It happens for several different file types (JPG, TIFF, and PSD). My library settings are ON for "Include Develop settings in metadate inside JPEG, TIFF, PNG, and PSD files", and OFF for "Automatically write changes into XMP".
Is there another setting somewhere I should check? Any insight into why this might be happening?
UPDATE - I originally stated DNG files were sometimes included in the problematic image list. But the menu item Metadata --> Update DNG Previews & Metadata corrected that issue, so I removed "DNG" from the description above.