Erratic behaviour with Gizmo selection

I’ve been noticing some really weird behaviour in Unity 6 Preview, related to the selection of objects - more specifically of their gizmos.

Context: I have a bunch of Prefabs whose children are hidden in the Inspector using hideFlags. This makes them unselectable. So I draw an invisible bounding box gizmo to allow to select them.

Now, in Unity 2022, the selection works perfectly.
In Unity 6, I get a lot of random behaviour when I click in between objects. Sometimes the selection cycles between two random objects. If I rotate the camera, the objects that are selected change.

Here’s a video showing the behaviour, and how it works flawlessly in 2022, but very randomly in Unity 6. At the end of the video I turn visibility of the gizmos on (they’re green).
Clicks are highlighted by a black circle.

To note is that I am 100% sure there is no invisible gizmo, I have done a lot of debugging and the behaviour happens even if I just draw a simple box gizmo.

Also another note: the weird behaviour goes away if I turn gizmos off, or I don’t draw any gizmo in my script.

I submitted this bug and got this reply:

Issue has already been detected and fixed last week, fix will be in release 6000.0.11f1. Sorry for the inconvenience, thanks a lot for taking the time to report it. Duplicate of Unity Issue Tracker - Incorrect element gets selected when trying to select uGUI elements in the Scene view

So I guess, it’s resolved from 6000.0.11f1! :tada: