TextEdit refuses to Save documents if you add an icon
I use icons to demarcate one document group from another. Sadly, I've run into a bug in macOS 12.4 whereby saving documents has become impossible when an icon is added to the document file. The only workaround is to remove the icon, then save. This is of course annoying and dysfunctional. It does not happen with any other program on my Mac, including when using a same specific icon that broke a TextEdit document.
A typical sequence of events is:
1) The document is written, saved and closed.
2) An icon is added to the file.
3) The document is opened and changed with the save being successful.
4) The document is opened a second time after the icon is added and it is now impossible to save, without exception.
5) Having failed to save, closing the document window the first time causes a save dialog box to come up. The save is successful.
6) When the same document with icon is opened again, then its window closed for this second time, it is again impossible to save, without exception.
RESULT: Having gone through the sequence noted above, the user is not stuck with a thoroughly unsavable document, the end. Again, the only workaround is to remove the icon.
This bug is entirely repeatable with no exceptions on my system: MacBook Air M1 with 16 GB RAM and 8 core GPU, aka MacBookAir10,1 model number A2337.
The sequence of failure messages:
4) Second Save after adding an icon:
6) Second window closing after adding an icon:
NOTE: The icon affected documents are not 'locked'. Using a Terminal command to 'unlock' such files...
sudo SetFile -a l file.ext
...Results in failure and confusion by the Terminal because indeed the files are not locked. The failure to Save messages are wrong. Again: The files are not locked. There is no excuse for these failure to save messages. I have full permission to Read and Write to these documents, without question. That does not change during the sequence of failures. TextEdit is broken.
Now what? This isn't acceptable. This isn't how macOS works.