I had the same problem, to fix this you have to grant full disk access to Xcode by System Preferences > Privacy > Full Disk Access.
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags: