The wizard points at you and mumbles some strange words.
The firelball explodes! The fireball engulfs your wolf!!
Your wolf dies!
Your wolf’s corpse disappears in a puff of smoke!
The fireball engulfs the wizard!!!
The wizard dies!
It’s not necessarily irrational, though, for monsters to make kamikaze attacks, if you assume that their overarching goal is to stop the player. (Though, yeah, that’s a bit implausible.)
So this is one of my favorite crawl fun facts: Wizards can’t see invisible but can turn invisible and have fireball… which they cast… in melee range… because they can’t see themselves standing right next to the target.
If you wanna test, try giving a wizard a sInv ring in wizmode and see if it is eager to fireball your character.