Got this issue again with v13.1. I remembered a workaround from another thread for an older Xcode version.
While Xcode is still 'Analyzing' your archive, spam the 'Next' button. This allows you to press it immediately when it's enabled; right before the 'IPA processing failed' message comes.
I'm using MacBook Pro with M1 chip.
Works like a charm.