I was able to resolve this issue by revoking all certificates that were created by Xcode Cloud and building again.
You can do that here: https://developer.apple.com/account/resources/certificates/list
Topic:
Code Signing
SubTopic:
Certificates, Identifiers & Profiles
Tags: