Since I needed to find a workaround for this issue myself, I played around a little more. As suspected, this definitely is a race condition during the initial RealityView setup. I have a test project set up that adds two buttons and a toggle to the ImmersiveView in Xcode's template project. When I add
try! await Task.sleep(nanoseconds: 100 * NSEC_PER_MSEC)
at the end of the view’s make closure, all three UI elements are always active in the visionOS simulator on my MBP M2 Pro, 8+4 cores, 16 GB.
When I go down to 50 * NSEC_PER_MSEC, all of the UI elements work (most of the time - I’ve had a case where two of the three were active, but the third one, that is added last, wasn’t).
When I go down to 30 * NSEC_PER_MSEC, all of the UI elements sometimes work.
When I go down to 20 * NSEC_PER_MSEC, none of the UI elements work.