Aside from silly movies or bad TV shows where corrupt cops go out murdering just for fun, police officers do not want to have to fire their weapons. They do not want to kill anyone, and they sure don’t want to have to deal with all the paperwork required even when they don’t kill someone.
That even goes for “warning shots” fired into the air, because what goes up must come down, and can kill. That’s why firing a gun into the air is illegal pretty much anywhere (and abjectly stupid literally everywhere). Any cop who did it would be cashiered and, in the current climate if anyone got hurt, would likely face a felony charge.
So it doesn’t matter how justified you may think you were before the cop ordered you to drop your weapon: if you don’t comply, you are no longer in the right.