Creative Cloud updated Photoshop to 22.4.2 and I am now getting the same problem periodically. This is just a 57 MB file with hundreds of layers. I was able to edit it last week — and for a year before — (before the upgrade) without problems. I have to shut down Photoshop and lose any work I have done but this problem occurs randomly without warning. When the error occurs, I am unable to save as any other format. I have no add ons and my computer is unchanged for six months. The only thing that has changed is the new version of PS.
I am able to create a new file reliably with a single layer and save it. I can also open, modify, and save a file that is 440 MB with just three layers.