As the issue only happened on one machine and Xcode 15 and 16 were also hanging making a change to a specific code file I decided to re-install my Mac. It turns out that the issue was with some file in /Library.
Now everything is working ok.
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags: