I had exactly this error, reproducible with every command line build or test run. The project was using Xcode 14.0. When I switched to 14.2, the issue is no longer reproducible.
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags: