First off, what kind of scorer doesn't realize this when the foul is reported?
That said, it is a technical foul either way - having the scorer change to match the player or having the player change to match the book. Had the player not fouled, you would have been okay (just don't put him back into the game). When the scorer records the foul, though, they have to change the book to match your #22 - team technical, 2 shots + ball for the other team, and you're now "safe" for any other changes of numbers for the rest of the game.