I can export successfully from my Mini M4 after using "Clean Up" on a photo.
Is the library located on your boot drive/
Have you installed and run any "cleaning", "optimizing", "speed-up", anti-virus or VPN apps on your Mac?
Give the following a try in order:
1 - launch Photos with the option key held down and create a new, empty library. Import a couple of photos into the library, edit with "Clean Up" and to export as a JPEG. If it's successful close the test library, open your main library and try exporting again.
2 - if the above doesn't help launch your main library with the Option+Command keys held down and restore/repair the library. Try an export after the repair.
Reort back with the results.
