Skill on right mouse button changes after quick casts

I’ve got (e.g.) glacial spike on my right mouse button. Use F4 and F5 to cast (e.g.) Blizzard and Frozen Orb. Sometimes the right mouse button skill gets replaced by either Blizzard or FO in the middle of a game. Once again: In the middle of a game, not when starting a new game.

I have the same and can reproduce while in town:

I am a sorc and have F3 bound to frozen armor. On my right mouse button there is teleport selected. I have enabled ‘quick cast skills’.
Now when I am in town and press F3 on a party member, my sorc runs towards the member, somehow interacts with it and places frozen armor on my right mouse button instead of leaving teleport there.