I'd think the homeless guy doesnt have the current mental privillage to understand exactly what might happen if he goes for the officers gun. If the police are actually protecting the public they have to take this into account. Decision making is different at different times.
Conclusion: If you are a good cop its your job to not let this particular guy in range of your weapon. Seriously this is an embarrassment for the police.
kind of hard to arrest and cuff someone without him being in range of your weapon unless you have telekinesis