I have only just come across this issue today when trying to make some minor edits to a couple of existing jpg images which I had previously edited on the same iMac without any issues.
All I am wanting to do is crop the images slightly, and when I click 'Save', I keep getting the error message above. I have tried this for a number of different images and the error message continues. I have done some internet research and followed the steps outlined in https://helpx.adobe.com/photoshop/kb/program-error-opening-psd.html, including rolling back to version 22.0.01 without any luck. I confirm that I did have the most up to date version being 22.3.1 and this also had the issue.
Interestingly, when I try to edit on my Windows PC running Windows 10 there are no issues, only on the iMac. The Mac is running OS Catalina 10.15.7 and hasn't had any issues previously, including working on 50mb raw files.
Just to confirm, the images I am trying to save only have one layer (background), they are not multi-layered files as some other YouTube videos have suggested is the issue.
Just an update....seems as though the issue was with an external SSD that stored the images I was trying to edit, hence why the Windows PC didnt have the same problem. When I tested an image saved to the hard drive of the Mac, I didn't have any issues.
So I ejected the SSD, plugged it in again and sure enough the problem has now gone.