I just recreated the provisioning profiles (edit, rename, save, download) and then uploaded and it worked.
Another thing, while I was having the problem before fixing it, I had a previous build in TestFlight which was built with the previous provisioning profiles, so I tried to release it. It failed and I got an email saying that the profiles are invalid.
So it seems like a bot at Apple (either software or human) revoked something that was used to validate the profiles. One of the reports in this thread suggests that this was reverted.
Topic:
App Store Distribution & Marketing
SubTopic:
App Store Connect
Tags: