Only a good guy with a gun can stop a bad cop with a gun.
He tried to do what he knew was the right thing to do. Sadly, it wasn't exactly the right thing in the eyes of the officer involved. Therein will lie the crux of this matter: what led this officer to believe that shooting the man was the correct response? Where did the system fail? Was it at the precinct leadership level? The academy level? Societal or socioeconomic? Because there was a pair of failures here: something or someone failed to prepare the officer for how to handle this situation, and more heart-breaking, something or someone failed to keep the man alive.