I have a very stranger behaviour. Due to a bricked Mac mini DTK I had to update my iMac to the latest beta version of macOS. I could start using Xcode and everything worked