Failed to find Xcode installed with Metal Compiler. Please install Xcode and run Xcode.app to accept the agreement, or make sure the active developer directory is set to the current Xcode installation

Failed to find Xcode installed with Metal Compiler. Please install Xcode and run Xcode.app to accept the agreement, or make sure the active developer directory is set to the current Xcode installation (using xcode-select).

You must install XCode version 13.something, and run it at least once to set it up correctly. Then make sure version 13 toolpath is selected in preferences.
Current version you get by default from Apple is 14, so you have to go to developer support downloads and download the last version of 13.x

I see that the same problem that I have is being solved for several years. UE doesn’t see Xcode and can’t launch it because of that. I’ve tried the various detailed tutorials I’ve found to no avail. Is this really the right solution? I’ve wasted a good 3 hours searching and trying in vain and I’m angry. Is it not possible to give some instructions right away in the installation? I really have no idea what to do.