I thought that stuff like this couldn't happen on Wayland by design but maybe that's only true for keyboard inputs. Unfortunately, I have no idea how to help you but I hope that this information was at least useful to someone who knows more than me.
It's an issue even on Windows, Some games just like to hog your mouse inputs even when you tab out of the program. Worse is a few games I've played that locked my mouse to the middle of the screen when I alt tabbed so I couldn't click on anything!
I would guess both the game and discord are xwayland and since it all happens on that side that happens.
Seems like a similar thing to the xeyes trick to check if an app is really running on native Wayland: if the eyes don't move, mouse events aren't going to an xwayland client.
It's all xwayland. Wayland support in Wine/Proton is barely usable yet. Even Valve's gamescope, although a Wayland compositor/client, still only exposes xwayland by default.