I bind my hero to 1, pet to 2, and courier to 3/4/5.
When playing Tremble, I found that there's a bug that makes these group select hotkeys not work mid-combat with consistency; I don't know what makes it happen, but when you're mashing right click and QWER/alt, hitting 1 and 2 does not swap between the pet and hero properly sometimes.
Its not quite consistent if you don't know what causes it, now is it?
Are you sure your keyboard isn't ghosting? Some gaming keyboards are designed specifically to not lose any commands that you tap into it no matter how quickly in succession they are. I have experienced ghosting before some normal keyboards.