I have about ten UIs with buttons in my scene. I can cast my XR Ray on all of these UIs and the buttons work fine except two. The buttons on these two UIs are clickable but the rays are not showing on them. I don't know why
I managed to solve this by adding an XR Simple Interactable component and a box collider to these two canvases. One thing is that if the collider protrudes out too much, the xr-ray will not be able to interact with the items on the canvas, the end point of the ray will be front of the collider. So, I made the canvas as tight as possible and it worked as expected.