A goalkeeper substitution made seconds before the end of extra time is a shootout tactic. The laws allow it, and the conditions under which it works are narrow.
The substitution must be made while play is live
A team may only change a goalkeeper if it still has a substitution available and the change is completed before the match period ends.
Once the referee signals the end of extra time no further substitutions are permitted, so the switch has to be made with time still on the clock.
Coaches therefore watch for a stoppage in the closing minutes, which is why these changes so often follow an injury break or a goal kick.
The case for a specialist rests on save probability
Some goalkeepers are demonstrably better at the specific task of a shootout, which involves reading a run-up rather than reacting to open play.
If a squad contains a keeper with that reputation and the starter does not have it, the swap trades ninety minutes of familiarity for a few kicks.
The trade is only sensible in the last possible seconds, since a specialist introduced early would have to defend live play he may be less suited to.
The cost falls on the player being removed
A goalkeeper taken off immediately before a shootout is publicly judged inadequate at part of his job in front of everyone watching.
Managers who use the tactic have to have prepared the player for it beforehand, because discovering it during the match is corrosive.
Squads where the possibility has been discussed openly handle it far better than those where the decision arrives as a surprise.
The incoming keeper starts cold
A substitute arriving from the bench has not touched a ball competitively and has to face the first kick within minutes of entering.
Reserve goalkeepers warm up through extra time partly for this reason, and staff will have them moving well before any decision is taken.
Even so, the physical readiness is imperfect, and it is a real cost weighed against whatever advantage the specialist is thought to provide.
The psychological effect runs both directions
Takers facing an unfamiliar goalkeeper lose whatever preparation they had done on the starter's tendencies, which is a genuine disruption.
They also face a keeper their opponents have just declared to be the better shootout option, which is a statement of confidence delivered without words.
Whether that outweighs the disturbance to the substituting team's own composure is the judgment call, and it is made under more pressure than almost any other in the sport.