This is late, but I was able to solve this, but rather in a dumb way, for me I zipped the entire project from going to my map scene, then file → zip project option and then i went to the new zip, unzipped it, and opened that one and tried to build it. That worked and im setting up my github version control now, and I think you all should too. Also more than likely some file or blueprint is currupted, for me it was actually the autosave blue print that was instantly crashing my game on opening the file, so I knew it had something to do with that. Removed it and used an older autosave of my gamemode blueprint from a few days ago then did that zip process and it worked to package it (specifically it used to always fail on cooking). After that I make another zip to experiment if I could add back one of the newer autosave and i added the most recent autosave possible before it started crashing again.
There was also an issue that I myself caused due to chat gpt telling me to fix the issue I had to delete the redirectors, well it lied to me, you are supposed to right click and fix them if present. Additionally if you end up deleting the redirectors if I remember correct you can go delete DerivedDataCache and Intermediate folders and then right click the uproject (not in ue5 but in your explorer directory of the game) and generate the visual studio files. I cant remember if this was my solution for that other issue or something else, but that was another thing i did that might have contributed to it fixing it.
All in all if I used version control this would have been fixable very easily.