When the turret is connected to a power source mode is activated, and the player is standing within the turret's area of effect at the moment a zombie spawns, the turret incorrectly bypasses the friendly unit check and applies damage to the player, treating them as a valid target.
That's probably not a bug. Turrets hitting the player isn't uncommon. If you are in front of them and there's a target, sometimes you'll get hit. That's happened to me numerous times over the years. But perhaps it is something they can adjust.
I've done some testing and I don't believe this is how it should function so I am writing it up for the Devs to take a look into it and see how they can improve it thank you.