If they took him into custody, then they are to blame. Before taking a child or anyone else for that matter into police custody, they must have to have developed a reasonable suspicion that a CRIME has been committed.
Unless there is a criminal statute that prohibits anyone from brandishing an obviously toy gun (it had the obligatory orange tip) without pointing it at anyone or displaying it in a menacing manner, then the police were obligated to tell the school to take care of the problem themselves and to leave.
It is discretionary with police whether they take someone into custody, but they must have a reasonable suspicion that a crime has taken place.
If this was my kid, I'd sue the $@#%%^%'s
When I was a kid we brought our toy guns to school in our Roy Rogers lunchboxes and played Cowboys and Indians at lunch. Back then they were made of metal.
Perhaps the Police put the kid in “Protective” Custody to keep the unreasonable school officials away from him until they could turn him over to his parents.