The movie Heat addresses this scenario in the opening scene. A guard is shot 'accidentally' during a robbery even though they didn't intend to kill anyone. At that point they killed all the guards because 1 guard or 3 guards, it had become a capital murder crime so might as well not leave any witnesses.