It's always good to learn from mistakes especially if the mistakes are someone else's. In some schools (usually rural), it may be ok to talk about guns only if you mention bird hunting or deer hunting in the same sentence. However, in most schools gun talk is a no no. Never, volunteer information about any handgun, AR or other not readily known to be a hunting gun. Example: "What's in that big safe?" "Oh, it's just my grandpas old 12 guage and the title to my bike." "Does the gun work?" "Gosh, I doubt it. It's been a long time since I've been duck hunting."
As for any kid who mouths off to a teacher, well that's obviously wrong. In a few short years, he'll be in the world of work. Most bosses won't put up with any lip. Few bosses will take the time to teach a youngster what mom and dad should have taught him. No job, no money, no fun.