Edited Finder comments are stored in an invisible .DS_Store in the same folder as the document, and a secondary copy is generated in a xattr metadata com.apple.metadata:kMDItemFinderComment for the file.
Finder only seems to know about the first. Conversion between the hidden .DS_Store file and the file’s xattr is one-way. There’s no syncing in the other direction.
So if the .DS_Store file is lost (in non-Mac file system or via some backup workflow etc), then the Finder Get Info no longer displays the comment although the xattr metadata still has it. When testing, notice that Finder caches that info so peeking into the folder in some part of the workflow might make a difference.
https://eclecticlight.co/2020/11/06/finder-comments-worth-avoiding/
https://bombich.com/kb/ccc6/preserving-finder-comments-and-tags
...
Some tests:
cat .DS_Store
Bugcmmtustra.jpgcmmtustrFinder comment.
xxd .DS_Store
00000000: 0000 0001 4275 6431 0000 1000 0000 0800 ....Bud1........
00000010: 0000 1000 0000 0086 0000 0000 0000 0000 ................
00000020: 0000 0000 0000 0000 0000 0000 0000 0800 ................
00000030: 0000 0800 0000 0000 0000 0000 0000 0000 ................
00000040: 0000 0000 0000 0002 0000 0000 0000 0001 ................
00000050: 0000 0001 0000 1000 0067 636d 6d74 7573 .........gcmmtus
00000060: 7472 0000 0000 0000 0000 0000 0000 0000 tr..............
00000070: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000080: 0000 0000 0000 0000 0000 0001 0000 0005 ................
00000090: 0061 002e 006a 0070 0067 636d 6d74 7573 .a...j.p.gcmmtus
000000a0: 7472 0000 000f 0046 0069 006e 0064 0065 tr.....F.i.n.d.e
000000b0: 0072 0020 0063 006f 006d 006d 0065 006e .r. .c.o.m.m.e.n
000000c0: 0074 002e 0000 0000 0000 0000 0000 0000 .t.
exiftool -G1 -a -s -api RequestAll=2 -MDItemFinderComment -XAttrMDItemFinderComment a.jpg
[MacOS] MDItemFinderComment : Finder comment.
[MacOS] XAttrMDItemFinderComment : Finder comment.
xattr -l a.jpg
com.apple.metadata:kMDItemFinderComment: bplist00_Finder comment.
Finder comment edited with xattred.app -- these tags are not synced and Get Info still shows the old "Finder comment." saved in .DS_Store anyway:
exiftool -G1 -a -s -api RequestAll=2 -MDItemFinderComment -XAttrMDItemFinderComment a.jpg
[MacOS] MDItemFinderComment : Finder comment.
[MacOS] XAttrMDItemFinderComment : Edited.