Let's not forget that A is a participant also and that team A attempted a throw-in to a location where team B could kick the ball. This isn't a good throw-in effort on the part of team A.
If you feel it is unjustified that Team A looses the next AP (that was going to be Team B's if the throw-in was good), think of it in that light... team A used their AP to make a poor throw-in effort but luckily got the ball back because JugglingRef was waggling a foot in the flight path.