Worst case, I'd say that you could be seen by the responding officers, the investigating officers and the district attorney as a bad guy in this situation, that the fact damage occurred and people got hurt was made certain by the fact you came out blasting. Particularly if things go very wrong after you pull your sidearm, this threat is a very real consideration. Depends on their biases, prejudices and attitudes with respect to a citizen to "takes the law into his hands" and jumps into a situation such as that, particularly if folks get hurt other than the criminal.
Read and understand your state's statutes regarding the use of force, the use of deadly force, as well as the case law in situations where citizens responded in an attempt to stop crimes.
Of course, there are a host of pros/cons to intervening. To what degree one or more of those factors will be a concern will depend on the person and the circumstances.
For myself: It depends on the severity of the threat/risks; the likelihood of my stopping it; and the likelihood of being seen as the good guy in this scenario. The impact on my family matters much, to me. Many situations are crystal clear, while some are far from it. Each situation is different. Generally speaking, the laws will support honorable, upstanding actions to assist others, stop crime and so on. But the risks of failure or being taken to task for such actions are very real. An attempt is fine ... but at what point does it become less enticing if it costs everything you've got, impacts your family badly, doesn't even succeed, etc. Much to think about.
Leaving aside the legal issues (which are considerable and important to understand), unless you're armed with a 12 ga shotgun loaded with full-bore 00 Buck, you most likely won't have a guarantee of "dropping" the perp with a shot. There's a very real chance that you could wind up creating a situation where a very angry and violent armed criminal now has a gunshot wound or two before he opens fire on you and maybe the clerk, too.
So I'd keep in mind the basic principle that the introduction of gunshots into a situation rarely makes that situation a better one. It's the ultimate last resort. If a robbery is in progress and no shots have been fired, the best outcome is one where no shots are fired. As long as there's a reasonable chance the robber will take the money and go, I'd hang back and see if that's what happens.
The goal, from my perspective, is to live a long life in which I never will have never had to use any of my weapons to injure or kill anyone. If some bad situation happens that prevents me from reaching that goal, it will be extremely unfortunate. So I'm always leery of any topic of discussion that has a whiff of "is it OK to shoot now? can I use the gun now? am I 'good to go' now?" etc.
Even a 12 Guage is not a guarantee of a stop.
The number of rounds, or the caliber is of less consideration than placement. That's why accuracy is important.