Multiple versions of Xcode can coexist.
Xcode 14.3.1 probably runs fine under Sonoma - have you tried?
You will need to set the active version of Xcode using xcode-select -s /path/to/active/Xcode/Contents/Developer
https://github.com/XcodesOrg/xcodes is a handy tool to download and unpack Xcode versions more quickly, and provides a GUI to activate the desired version.
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags: