Sorry if it's already been posted , but after a quick search I didn't find anything about that.
It happened to me twice with regulus, when I try to cap the flag he's auto-attacking it ... It can be quite annoying because if creeps come to attack me , I have to micro-manage regulus to shoot them .
I'll try to reproduce the bug, but each time, it was after tuning up his crossbow (upgrading max range).