It doesn't matter if he was putting it on the ground in response to the officers' repeated commands to put it on the ground?
No. First, what matters is what the officers reasonably believed he was doing. Second, that he failed to comply or respond after so many repeated commands is relevant to the mindset of the officers and what would have been reasonable for them to believe at that moment.
And I use the term "unlawful" as an umbrella to cover things like threatening imminent death or grave bodily harm or any other crime for which deadly force would be authorized (because they are worded in various ways in applicable statutes). So if he was threatening death or bodily harm against a person at that time, it would be an unlawful act.
It doesn't matter if he was actually threatening death or great bodily harm at that time; what matters is whether the officers reasonably believed that he was doing so.
And 20/20 hindsight evaluation doesn't matter? why do we even bother having courts then? That's literally what court verdicts are based on.
No. 20/20 hindsight evaluation does not matter. We bother having courts in order to evaluate the reasonableness of the actions, beliefs, and fears of the actors in question at the moment they acted, based on the information at hand to those actors at the moment they acted.
Are you even familiar with the concept of the reasonable man standard? If you carry a firearm, you damn well ought to be, or you have no business carrying a firearm.