Make sure you are actually targeting your intended target when the action commits. I've seen it do that kind of thing when my reticule is locked on something and I've moved the selection to something else but not actually locked the focus on that newer target.

Not talking a target lock like for strafing, but when you've selected your main target and then you can select something else with the directional buttons on a game controller to commit an action. Like curing a DPS when the tank is main target, or trying to spread damage around a group with single target actions (like that guildhest where you have to take all the mobs down together). If for some reason your first press to use an action fails it may switch back to your main target--or you may have miscued that side target, so you may actually be targeting something too far away or you lost line of sight because it moved or something (that happens a lot on the crazy instances with long cast times).