I can confirm that the problem is with macOS 12 Monterey.
Archiving using Xcode 12.5 and uploading using Xcode 13 only lets you use TestFlight and not publishing to AppStore.
Solved this problem with downgrading to macOS Big Sur. This is the only solution I've found after days of trying everything on the internet.
For anyone who didn't do TimeMachine backup like me:
- Download Big Sur InstallerAsset.pkg from the web (Just type Big Sur installer download in google [do not download from the AppStore it is not the full installer and you won't be able to create the bootable USB]).
- Create a bootable USB with at least 15 GB available, follow Apple's instructions.
- Format your mac (of course backup before you do that) and reinstall Big Sur from the bootable USB you've made.
I'm now able to upload, publish, and test using Xcode 12.5 while I still have (also) Xcode 13 for playing with the new updates.