Swap your keybinds, bar to bar.
My inexpert opinion is that the game defaults right click (and sometimes left click, it happens to me) to activating the first slot in your default(the one apparent at character creation) action bar.
Mine goes Q12345ER(mouse4)(mouse5)
On most of my characters, it is their "free" attack, and so I assumed that's what right clicking did, however on my Sorcerer it is the cast-time lightning with no cooldown whose name I can't recall, and sure enough it does it upon right clicking a valid target.