This issue is fixed by a QFE for 5.0.3 (“Platform Mac is not a valid platform to build” error with Xcode 14): http://cdn.unrealengine.com/qfe/QFE-5.0-Xcode14Support-CL-22337428-PF-22380667-Job-cbd57f.zip
Details in this post (please read it before applying the QFE): Current Available Quick-Fix Solutions