Wow, quite frequent... Bugs are always my top priority because
there shouldn't be any Noticing the red border is a good start, though theoretically that's purely a cosmetic thing which wouldn't impact the input capabilities of the window. I wonder if it could have anything to do with the resolution, since 1440p isn't too common among the players, but still that's quite unlikely a factor as I see it.
So Alt-Tabbing had no effect?
Another quick test to do: When it happens, try using the keyboard commands to drop an item from the inventory (Alt-#), or attach one (Ctrl-#). If that also doesn't work then we'd know it has something to do with the game input logic itself, and not something particular to the mouse, which would be a step towards confirming the where the problem might be.
Thanks for the feedback so far, and sorry for the inconvenience! I'm very curious what could be behind such weird behavior.