Xcode 16 beta does not let me log into my account
Maybe you could record system log messages and filter the irrelevant ones with the Console app to find out more about the error behind this?
As a workaround, you can install Xcode 16 on the host and send your binaries / app to your VM (you could use File Sharing), though setting up remote debugging will require additional steps.
M1/2/3 laptops never allowed iCloud authentication for guest VM, not to sign in with your Apple ID, not to let apps use Apple ID.
It seems like that might change for macOS 15 (does not work yet in DB1), but when it will work it will work only on macOS 15+ host running macOS 15+ guest.
Recommended
Signing into an Apple account in Xcode when running on a VM is not supported at this time.