Nobody has Godlike omniscience. We all operate according to the information we have.
The information the officer had: he saw the kid was armed. He chased the kid. He did not see the kid toss the gun. The information available to him would lead any officer to think that the kid was armed and a deadly threat.
And under the same set of circumstances and in the same jurisdiction you or I would be facing prison.