In your situation as described, here is what happens: As a ref, we have an immediate "play-on" (which should not last for more than 1-3 seconds.) Once team A gets the ball the "play-on" is over ( correct mechanic is to yell the color of the team that is to get possession, which indicates the play-on is over). Since the infraction is a "loose ball" play, no time will be served.Once possession is achieved, the players behind the restraining line are released, thus
no time can ever be served for this violation; only awarding the possession of the ball.