This Sofyan Amrabat red card vs South Africa saw the Morocco midfielder sent off in stoppage time. The referee originally gave him a second yellow card, but he was briefly recalled to the pitch for a VAR check. However that resulted in the ref directly giving him a red card, and Tebogo Mokoena scored from the resulting free kick to put Bafana in the quarterfinals.
Full incident- Amrabat red card at AFCON 2024- second yellow converted to direct red by VAR
Official YT Video, vid starts at point of Amrabat last man foul on Mokoena (24:15 mark)