Many factors may contribute to these tragedies, ranging from carelessness to racial bias, but it is also possible that some of the shooters actually perceive a weapon when none is present due to affective realism in a high-pressure and dangerous context.
Implicit bias makes the misattribution more likely by giving negative valence to Black people. You could have phrased it like that