I recently saw a movie from 1984 called Teachers, with Ralph Malchio, Crispin Glover and Morgan Freeman. The character in the movie, a 16 year old stoner named Danny who had schizophrenia, anxiety, depression, and kleptomania disorder, pulled the gun he stole out of the locker during the drug search. The cops told him to drop it, but he was being all anxious and was just pointing the gun in the air and at the locker. The cops shot him anyway. Why did the cops shoot him even though he wasn't planning on using the gun?
I just re-watched the scene, and yes, Danny is waving the gun around while the police officer is telling him to put it down. He starts like he might be putting it down, but then, right before the police officer shoots, Danny jerks the gun up, looking like he might be firing. The police officer had to protect himself and the others in the hall.
When you're a police officer faced with someone holding a gun, you sometimes only have a fraction of a second to make a life and death decision. He didn't know what was going through Danny's mind. He most likely didn't know him at all, just that he had a gun and wouldn't put it down.