Pstemarie: The henchman AI for summoned creatures is a little quirky, but I've never heard of behavior such as attacking an ally - the script is configured to simply not allow an associate to attack something that is not hostile towards you. My guess is that something went wrong with your character's personal reputation regarding the guard, forcing the badger to perceive it as an enemy.
As for the goblins, the AI sometimes takes a few seconds - maybe even a round - to process commands. Thus it is possible to get whacked at low levels before the summoned critter ever acts.
Well actually after replaying it, It was simply the graphics making it look like the badger was attacking the guard, but the text showed he was doing damage to the mage behind the guard.
I was trying to get through the game without any mods for the 1st playthrough.
But that's not looking like a very good idea with the AI the way it is.
I have told the Cleric many times to heal me when I'm less than 75% health,which she agrees to.
But she has never once done it & is quite happy to watch her employer die unless I say Heal me. Is there something else I need to do to get the heal at <75% option to work?
I think I was a bit optimistic thinking I could do a 1st playthough on default settings, when an escaped prisoner can throw a fireball that takes my level 3 sorcerer & my familiar from full health to dead in one hit, before I can throw a little snowball at him.
Or maybe I'm just going into the wrong areas too soon.
I'll start again as a fighter, at the moment my inventory has all I can carry & I don't yet know what stuff I need to keep. (my paid mercenary won't carry anything for me)