I’ve encountered this several times. I’m helping guards fight off an enemy and accidentally kill a guard who gets in the way. They then turn on me and I can either submit and go to jail or choose to kill the guards I was trying to help.
The developers should really figure out a way to excuse accidental friendly fire, because this is rather annoying.