Had the new player entered the pitch? "Refused entry" seems to suggest not. In which case the player should have been allowed back on as far as I can tell.
Even if the new player had entered the pitch, wouldn't that mean the referee allowed the substitution despite the different number, then changed his mind after the fact (in effect 'undoing' the substitution)?
Not having a go. This is just interesting.