My thoughts/comments.
The OP states "mag catch" and also "slide catch" in the post.
The OP talks about the magazine(s) dropping out, but I suspect the OP wasn't present to see his son qualify at the range; 2nd-hand info is possibly presented based on speculation and his son's comments.
A broken slide stop (sometimes called a "slide catch") can also result in slide lock backs.
We've got no photos of what was broken and if a repair was performed.
As previously stated, we're unaware of any "factory" 21-round Glock 17 magazines. Perhaps these were from the Magpul "factory" or the round count is just mistaken. Perhaps the Glock model is mistaken. Perhaps the problem/broken part name is mistaken.
I've had a couple of worn-out G30Gen4 magazine catches which caused my mags to immediately drop upon firing; which resulted in worn-out magazine notches; all due to a bent magazine-catch spring. Glock replaced the parts. I wouldn't know if the mag-catch spring was inadvertently bent; or was the spring metallurgy somehow not to spec; or was the mag-catch's polymer out-of-spec; or were the several Glock 30 mags' polymer-bodies out-of-spec. I just know what parts were replaced to cure the problem. (At this time, there was another poster with the same problem which occurred with his G41, which has some identical parts.)
If it was my mag-catch spring, was the spring bent due to poor metallurgy; bent at the factory; or bent from me if I'd worked on my G30gen4?
My G30gen4 experience may or may not be related to the OP's son's G17 (gen unknown). I just wanted to share a bad mag-catch system could occur. All three parts in the system (catch, spring, mags) needed to be changed to fully cure the problem.
I've also had broken Glock slide-stops on various Glocks. Either the spring would break or the thumb pad would break off. Me, normally using an extended slide-stop to "drop" the slide, probably contributed to the pad breaking off; while either scratching the slide-stop's spring during several detail strips or perhaps the spring just getting brittle from many rounds being fired may have contributed to the spring fracturing (just my speculations).
Just my thoughts/comments. Perhaps the OP's son could come on here and comment with 1st-hand knowledge as to what occurred.