maybe exporting the game to windows/mac/linux executable it will work? I know that my game also was not confining the mouse to the game screen, it only worked exporting the game executable (maybe some issue with the brave browser?)
I uploaded a Windows build! I believe that it's a browser issue :(