Oko What Law covers this, I could find under interpratations of the Law,what to do if a team scores with an extra player, and I understand the caution for the extra player. So 10min into the 2nd half the referee notices the 12th player. He removes the 12th player, he believes the last time he was certain was 2mins earlier when a subsitution had happen, and the player must of stayed on accidently. In that period no goals where scored, is a caution still needed. Maybe it was poor management of the interchange.
My understanding is yes, a caution is required. The game should be restarted from the interchange two minutes prior. In this case no goals were scored but if they had been they would be voided. Any disciplinary actions taken in those two minutes would stand.
Any opinions expressed here are mine alone and not necessarily indicative of any formal Referee's body unless otherwise stated.