You're talking about a different case where you have a backup of the latest wallet. Which doesn't match the scenario I've stated.
No, I'm talking about a backup of a HD wallet, made at any time.
I have, in fact, either written or reviewed all of the Bitcoin Core wallet code .