I experienced similar issues once: I used UI-Toolkit for the UI and in the WebGL build I could not detect clicks on 3D objects. It seemed that UI-Toolkit was "blocking" the mouse with invisible UI-Elements that should not be there. I was able to workaround this by using "abolute" positioning for top-level UI-Elements.