I had this problem as well on my iPhone 12 mini with iOS 15, using Xcode 13. Reboots of the iPhone and Mac didn't help.
In the end (after multiple hours of fiddling) it turned out that there was a message waiting on my Apple Watch whether I trusted my computer. After confirming that I did the iPhone was correctly setup.
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags: