This was a wrong shooting. Having said that, traffic stops are risky, and the person moved so fast ducking back in the vehicle, that he could have been grabbing a gun, and that would be dangerous for the officer. Officers are aware from training how fast a person can suddenly grab a gun and shoot them. Unfortunately, it's hard to prevent that risk. The solution is not for the officer to shoot in a situation like this.
Now, if the person has responded slowly and calmly - said they were going to get their id from the dashboard and slowly moved to do so - there likely would not have been a shooting. But that doesn't justify this shooting. It's why there's an old suggestion that people keep their hands on top of the steering wheel when pulled over - it's not legally required, but it makes things safer for the officer, which makes them safer for you. Don't move really fast, it worried the officer, and he does have a gun.
Even though this officer will likely and correctly be convicted for this wrong shooting, it would have been better for everyone if it hadn't happened.
Chalk up another one for police videos though, that help justice - even better if the officer were wearing one, but at least the dashcam.