Spent 20 hours troubleshooting the same error.
It turned out our problem was that we had added a row to our entitlements, "<key>com.apple.developer.associated-domains</key>" in our case.
When doing so, the app id capabilities have to be updated. Once that was done, everything worked.