Also I suspect sometimes if a particular unit has been promised but then proves unavailable, it's easier to renumber an identical one than break a plan (I think that's why Duchess of Hamilton spent a while in the US as Coronation)
Some conspiracy theorists would have it that Titanic & Olympic swapped IDs, but then never swapped back for obvious reasons - but I reckon that's hogwash
The first definitely happened, since the engine that crossed the Atlantic was crimson lake, to match the crimson stock (which was never used for its intended purpose as WWII intervened). The second didn't, since you don't plan for a freak accident.
Another swap that really happened was 4082
Windsor Castle and 7013
Bristol Castle. King George VI drove 4082 (briefly and slowly) during her naming ceremony, presumably when he was Duke of York. When he died, 4082 was just about to go into the works for a heavy overhaul, so the nameplates, numberplates and commemerative plaques were removed and placed on the recently-overhauled 7013 (with her plates ultimately ending up on 4082). Unfortunately for the Western Region's management, some rivet-counter spotted that the middle cylinder block was different, had a look at the works plate, then mentioned it to a reporter. Next day, one headline reported
'Royal funeral train hauled by FAKE engine'. The identities never swapped back, but the commemorative plaques disappeared.