canada
This is a standard defence-of-another / self-defence analysis
See
If Alice believes on reasonable grounds that there is a threat of force against John, then the defence called "defence of another" comes into play. It is codified at s. 34 of the Criminal Code:
34 (1) A person is not guilty of an offence if
(a) they believe on reasonable grounds that force is being used against them or another person or that a threat of force is being made against them or another person;
(b) the act that constitutes the offence is committed for the purpose of defending or protecting themselves or the other person from that use or threat of force; and
(c) the act committed is reasonable in the circumstances.
"Unless the accused subjectively believed that force or a threat thereof was being used against their person or that of another, the defence is unavailable" (R. v. Khill, 2021 SCC 37, para. 52). Such belief must also be based on reasonable grounds. They must also act with the subjective purpose of protecting themselves or the other person from that use or threat of force. There is also the final balance of reasonableness of the response, but I don't take you to be putting that into question.
As long as these are satisfied, then the defence is made out. And you haven't given enough information to know whether these elements are present.
Your scenario only presents evidential uncertainty
The scenario you describe only presents evidential uncertainty to the trier of fact. John's shout to "Don't shoot him" would just be part of the evidence relevant to establishing the reasonableness of Alice's belief that John was under the threat of force.