FCP X Crash on changing from proxy to original media

I am working on feature film, and it is almoust finished. Whole project I was working on proxy videos, and now when i want to change it to original video, so i can export film in better quality, it crash right away.

What version of FCPX and macOS? What is the history of the proxies? Are they FCPX-generated proxies or are they camera proxies you somehow were using in FCPX?

Are the proxies stored within the FCPX library (the default) or were they moved elsewhere?

This is a basic question, but is there 20% free space on the system drive and all external drives? If nearly out of space it can make applications crash.

Is the media on the same volume and path as when the proxies were first generated? Unfortunately there is a limitation in FCPX where the volume name when the proxies were generated is stored in the library, and proxies cannot be relinked. I haven't seen this cause a problem when switching back to original media, just mentioning it.

You could try creating another library, then copy the project (without proxies), then open that copied project, switch to optimized/original mode and see what happens. Using a new library sometimes helps. Note: before you copy the project, click on the new library, then open Inspector, click "Modify Settings" (don't change anything) and inspect the current storage location. By default FCPX will use the previously-clicked storage location (if external) and you can accidentally end up storing new library content in the previous library's on-disk location. If that works in opt/orig. mode but the clips are red, you can then relink.