That might be a mutter bug that happens when using mice that also can generate keyboard input events. You can check if you have such a mouse using sudo libinput list-devices. If for your mouse the Capabilities entry lists keyboard in addition to pointer, you are probably seeing this bug.