Macro bugs after a while

Hello, I use the following macro to cast Tempest when the buff proccs and Chain lightning if not. It works for most parts but after 1 or 2 pvp matches, or even normal activities, switching instances , it bugs and gets stuck on Tempest without me being able to press it. I believe the error message says “you need to learn this spell” or something. Any ideas of why this happens? The macro functions perfectly but it will eventually stop out of the blue. I have tried switching it to the spell ID’s and still performs the same. The only solution I’ve found that fixes it is reloging

/cast [known:Tempest] Tempest; Chain Lightning

Blizz’s implementation of some of the new mutable spells has been a mess since DF. Often switching talents can break things until a relog. If you’re getting a “you need to learn this spell” that would seem to indicate the Tempest it’s testing against with known and the Tempest it’s attempting to cast aren’t the same.