In my CCW class, the instructor posed the question, what would you do if you came out of a bathroom at a convenience store and saw the clerk held at gun point. His answer, go back inside the bathroom and lock the door.
He then went into a discourse about automatic reflexes and how just the startle reaction in someone with his finger on the trigger could get the clerk killed. To put a person down with a gun to someone else's head, you have to hit the midbrain. Otherwise, simply shooting someone could get the person killed on the other end of his gun. In this situation, you might end up the owner of a nice lawsuit by the victim's family.
His advice, conceal in good cover and take up a defense posture, armed and ready, but don't intervene UNLESS the perp is shooting already. Having a permit to a gun does not mean that we are LEO's in any sense of the word. Fortunately, most robberies do not involve murder. No way to tell the difference upfront, so taking a conservative role is the safest for all involved in most situations from all that I have heard. The examples previously of LEO's who likewise don't intervene when off duty is a really telling post.