Nobody is perfect. Not everyone can expect to do the right thing 100% of the time especially in sports. The margins are thin and every error can lead to something bad.
For athletes, this is true in spades but for referees, that margin is even thinner. NO ONE wants to see a referee make a mistake especially if it costs their team the game.
This might not have been exactly that but a referee did make not one but two of the same mistakes in an AFCON cup game between Tunisia and Mali where he called the game over, TWICE!
This has to be one of the weirdest things we’ve ever seen on a soccer pitch.