This isn't just a problem for high school kids, I think lots of trumpet players do this. I know I used to! I remember being in an orchestra rehearsal in college and feeling out of tune and pulling out. Still out of tune, out some more, etc. Pretty soon my slide is WAY out and so's my pitch. Finally in frustration I pushed it way in and just like that I was fine. A good lesson to learn. I also think that some horns have a sort of "sweet spot" for the tuning slide where the horn is the most resonant and in tune with itself. It can be a problem when that sweet spot doesn't agree with the ensemble or section. It's just a guess based on my own experience, but I think the mouthpiece can effect the actual pitch that comes out when the horn is in that sweet spot. But I don't really know, the physics behind all of that is way over my head.