I can’t say that I’ve seen this error since 3.1.3 was released. I think the first thing to try is running in 3.1.3.
If that doesn’t work, you can try the recovery steps outlines in this post: Corrupt or Otherwise Broken Audacity Project Recovery
Before you do anything, make a copy of your .aup3 project file, and try to work on a local copy (don’t use files on the cloud or files that are being replicated to the cloud).