It seems that it would otherwise silently skip the rescan for pre-backup used keys that are still waiting to be generated into the keypool?

See also #11249 
}
bool AddWallet(WalletContext& context, const stdshared_ptr<CWallet>& )
{
    LOCK(context.s_mutex);
    assert();
    stdvector<stdshared_ptr<CWallet>>const_iterator i = stdfind(context.s.begin(), context.s.end(), );
    if (i != context.s.end()) return false;
    context.s.push_back();
    ->ConnectScriptPubKeyManNotifiers();
    ->NotifyCanGetAddressesChanged();
    return true;
}
bool RemoveWallet(WalletContext& context, const stdshared_ptr<CWallet>& , stdoptional<bool> load_on_start, stdvector<bilingual_str>& warnings)
{
    assert();
    interfacesChain& chain = ->chain();
    stdstring name = ->GetName();
    
    ->m_chain_notifications_handler.reset();
    LOCK(context.s_mutex);
    stdvector<stdshared_ptr<CWallet>>iterator i = stdfind(context.s.begin(), context.s.end(), );
    if (i == context.s.end()) return false;
    context.s.erase(i);
    
    UpdateWalletSetting(chain, name, load_on_start, warnings);
    return true;
}
bool RemoveWallet(WalletContext& context, const stdshared_ptr<CWallet>& , stdoptional<bool> load_on_start)
{
    stdvector<bilingual_str> warnings;