It was likely an Airsoft gun, which are often replicas. Airsoft is used by people that do milsim because of how realistic the pellet guns can be; many of them are licensed replicas of the real ones. They're supposed to have an orange tip to clearly identify them as replicas, but those often get painted over by people that used them for armed robberies.
Some people used them as a training aid for USPSA and IDPA, because you can use them indoors, and the weight/mechanism makes them more accurate to life than dry fire training.
IF this article is accurate--if it was really a Glock replica, and if he really pointed it at the cops--then I don't know what people reasonably expect.
Well yeah if you run from cops and then turn around and point what looks exactly like a pistol at them, they're gonna think it's a pistol and shoot. Did the kid think they'd get scared and run away? Chalk this one up to the Darwin awards.