I just had the same error with Xcode 14.3.1 (14E300c). In my case I could solve it by signing an unsigned Apple-agreement.
IMHO the error message is quite misleading in that situation, and a more appropriate error message could save a lot of time.
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags: