Not surprised that it derps from <mo> to <t> sometimes!

I play on PC and went from keyboard onry to controller as my main playstyle just after 2.1 - only experimented with keyboard & mouse for a brief period so have never used <mo> placeholders in macros myself.

As such, all I can say for sure is that on PC, if you have both a hard- and soft-target and use a macro'd player-cast action with a <t> placeholder, it always procs on your soft-target and then snaps focus back to your hard-target, whereas pet-cast actions do not cancel the soft-target. Thus, changing the order in the OP's macro will work on PC - might not be the case if it prefers <mo> sometimes on consoles.

The OP's macro will work if you don't currently have a hard-target, though, as PC controller behaviour is such that if there isn't a hard-target to snap back to, initiating an action on a soft-target will proc the action and make the soft-target a hard-target instead.