I upgrade from macOS Catalina to macOS Ventura 13. Once I downloaded Ventura 13, restarted In recovery mode which there are 3 options: 1) Command + R = reinstall the current macOS the Mac has, 2) Option + Command + R: Install the latest macOS available for the Mac. 3) Option + Shift + Command + R: Install the first macOS version your Mac had. If you get an error then you need to Erase the Disk using Disk Utility. When all set was done, I downloaded Unreal Engine latest version which is 5.1 then installed it with no problem. Opening UE5.1 I got this error. So I installed Xcode 14.2 from Sign In - Apple and I followed the instructions and did not do any changes just clicking the arrows and choosing the corresponding selections. Closed Xcode 14.2 and Opened Epic Games App Launcher clicked on Launch UE5.1 and executed with not problem. Thanks and Hope this will help also.