I tried to upgrade to Xcode 13 and macOS crashed after getting most of the way there (according to the progress bar after ~2 hours). Just in case that was the problem I then upgraded to the latest 11.6 macOS version and tried again. Same result. I then put the existing Xcode in the trash and tried again. Same result.
I can't figure out how to stop the app store from trying to reload Xcode, so now I have a system without Xcode and that crashes every 2 hours.
Help!