In the recent U19 Women's match between England and Norway, the referee made a mistake in not allowing a penalty in added-time to be retaken after a player encroached. This is a clear misapplication of the laws.
Instead of replaying the entire match with a new referee, or accepting the result, the solution was to replay the final 18 seconds of the match at a later date with the original players and a new referee.
How was this decided, and when else could it happen? Was it special that it was a misunderstanding of the rules rather than a simple refereeing mistake, like not seeing the ball crossed the line? Would it be possible to replay a more significant part of the match (e.g the last 20 minutes)?