In that case, they should have run. Smart AI would retreat and take cover.
Not necessarily. An invincible player isn't the same as a player with full health. If they have it where the AI reads the players health and decides to be more cautious and use more cover when a player is at full health, that doesn't mean it will make the same reading on a player with essentially no health to read. It's like telling a AI to read how full a bar is, but then taking that bar away. All kinds of errors happen with it.
I'm just kind of assuming that's how it works since they didn't specify, but that seems to make the most sense as to why the AI would behave stupidly against a player with no health.