You are pressing s or w which changes your weapon by accident when you are done typing. A takes the weapon to the left, W takes the one to the right.
It's an automoatic lock-in, like it locks in without you knowing it. Not the selection of the wrong weapon, I'm sure if that happened, they'd already know.