Great question — answering as the UphillTech team:
In the case you mention, the red card offence would have then been yellow. From the IFAB - International Football Association Board : The referee can wait a few seconds to allow a possible advantage to develop, and if the non-offending team does not benefit and gains no advantage, the original free kick can be given. However, the non-offending team should not be given two chances, e.g. a player is fouled but recovers and has a shot at goal; if the player does not score, the referee cannot go back and give a free kick for the original offence. If the referee plays advantage following an offence that would have resulted in a red or yellow card being shown, the card must be shown next time the...
Full answer by OldPadawan: https://sports.stackexchange.com/a/29253 (CC BY-SA 4.0).
Need it done for your business? UphillTech.