It's not a lag issue, it's an order-of-operations issue.
They're currently applying the buff to your cast when you press the button, and not when the spell actually starts to cast. Therefore, with the ability queue system, you're able to get the second cast off with the buff because you pressed the button while the buff was up.
Presumably they'll fix it at some point to apply the buff when the spell is actually cast, and this will stop working.
I'm trying to avoid using it for the most part, as I don't want to get used to having the free casts and being screwed when they go away