Assume a bank robbery with one or more armed gunmen, in the City of Los Angeles, such as occur in movies or real life, who arrive yelling demands and brandishing firearms at victims but have not shot anyone. In fact, the robber(s) initially announce that "no one will be harmed if everyone cooperates".
Obviously, any number of bad things could happen to innocent victims if some self-appointed vigilante assaults a robber, takes a robber's gun, or opens fire with their own weapon, say, from a cracked restroom door, or some other position where the advantage of surprise might exist. Or, they could be the hero of the day.
To be clear, this question is limited to the case where the bank robbers have not physically harmed anyone at the moment the heroic civilian decides to be the first to initiate deadly combat. This civilian is not acting out of fear for himself or the lives of others, but simply believes they stand a decent chance of ending the robbery through superior position, tactics, or knowledge of deadly force or perhaps is hyped up on adrenaline and simply wants to "spin the wheel".
How does the modern legal system deal with such a person?
Note: The question is hypothetical, and I am not currently in California. There are a number of bank robberies there, so precedents may exist in case law.