Thats an easy solution. While controlling your minion you’re enshrouded in shadow magic or something that makes your character invulnerable.
Maybe you could hop in and out of the “eyes of the beast” to cast spells when you aren’t actively manipulating the boss, like when the offtank taunts. Your pet could remain but you would continue casting support spells for it.