Consider the following situation.
The players then walk to the head and measure all of the boules. They discover that B1 had actually gained the point. That means that after B1 was thrown, team A, not team B, should have thrown the next boule.
The answer to this question depends on whether or not we consider boule B2 to have been thrown “contrary to the rules”.
Some players and umpires hold that it was. Article 15 says that “it is the team that does not hold the point that plays,” so it seems obvious that a boule played out-of-turn should be considered a boule thrown contrary to the rules. Note that this doesn’t mean that the boule is dead. It means that the offended team may apply the Advantage Rule in Article 24, and choose either (a) to un-do the event by removing the offending boule and (if possible) returning everything else to its original location, or (b) to leave everything where it is and carry on with the game.
Other players and umpires, however, see the matter differently. In 2008, the national umpires for Petanque New Zealand (PNZ) issued a set of rules interpretations that held that a boule thrown out of turn was NOT thrown contrary to the rules. Following this lead, in 2012 John Degueldre, Director of Umpiring for Petanque New Zealand, issued the following ruling.
Boules played out of turn are not considered as an infringement to the rules
[i.e. as "boules thrown contrary to the rules"]but indeed as a mistake. Players making such a mistake penalise themselves by reducing or losing the ‘boule advantage’. In conclusion, players do not incur any penalty, and boule(s) are valid and stay in place. But it is still the player or team not holding the point that must play the next boule.
The practical effect of this interpretation is that, after a boule is thrown out-of-turn, everything is left where it is, and the game just carries on.
The bottom line
In a competition, most FIPJP-certified umpires will, I think, rule that a boule thrown out-of-turn was thrown contrary to the rules, and that the offended team may apply the Advantage Rule in Article 24.
Personally, I agree with Petanque New Zealand. It’s not clear what should count as being “thrown contrary to the rules”, and I see no reason to use Article 24 to further punish the hapless offending team. They’ve already been punished sufficiently. When they threw their boule out-of-turn they actually benefitted their opponents by increasing the opponents’ boule advantage.
Multiple boules thrown out-of-turn
Players sometimes ask what should be done if Team B throws several boules (say: B2, B3, and B4) before it is discovered that B1 had the point all along. The answer is that you should treat all boules thrown out-of-turn in the same way, no matter how many of them there are.