We had the same problem. Workarounds here didn't work, but this fixed it for us:
Make sure Access to Certificates, Identifiers & Profiles and Access to Cloud Managed Distribution Certificate are enabled for the account on https://appstoreconnect.apple.com/access/users/.
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags: