First run this command and set it to the path of the beta version:
sudo xcode-select -s <path/to/>Xcode.app
Then you will have to agree to the license with this command
sudo xcodebuild -license
That will prompt you to display the license and then type agree to accept it.
Then run this command
xcodebuild -runFirstLaunch
And now Xcode will open.
I just had this same issue and this fixed it for me on a M3 Max MacBookPro. I hope this helps!