I went ahead and tried to reproduce this issue. It seems that the simulator creates illusions due to transforming a 3D projection onto a 2D screen and the ray's draw order. So when the ray is not hitting a UI element that can be interacted with, it turns red. It passes through the UI which makes it seem as though it's pointing at the UI element. However, in this example scene if the ray is red, it is not hitting any UI elements. I have changed the rendering mode to two-eyed in the app simulator to help demonstrate this.
In the screenshot above, the unity scene shows that the ray is passing through the non-selectable UI elements, but in the right eye view it seems like the ray is pointed at the 'X' button but it is actually behind it. If you move the controller around in the scene view of the app simulator by selecting it and changing the manipulation mode to "rotate."
Ohh now i see. In editor i rotate all body, not the controller. So i couldn't focus ray to the top buttons because window was moving with me. I rotate controller as you suggest and everything is ok.
Look at the ray lenght. It wasn't clear for me at the begining and i was trying to point at the buttons using the end of ray. But correct is somewhere at the middle.
Two-Eye or one-eye. Don't matter in UI, but yeah. Better to not use Two-Eye in simulation.
In UnityEditor
AppSimRendering -> Device View -> Two-Eye Rendering
or
In App Sim Device View there is button
Is there easier method to rotate controller? Not whole body.
I'm glad I was able to help you solve this issue. The best way to rotate the controller only is to select the controller and switch the manipulation mode to 'rotate' and it should have some handles that allow you to rotate the controller to your desired orientation.