I logged a bug about this, feel free to give it a thumbs up, or comment on it or something, not sure what good that does.

Basically, the issue is a macro will EXIT/LEAVE/RETURN when the following conditions are met: Invalid Target, Not Enough Resources.

However, if an ability is on cooldown, it will skip to the next line, which is the expected behavior for the previous two cases. Unfortunately it doesn't work like that right now. I'm assuming this is an oversight, and that the macro system simply works like this because of the way action erroring was originally designed. I'm hoping we will get a fix, considering that right now macros are absurdly useful for melee and useless for mages.