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 
for (auto& load_  context._load_fns) {
        load_(interfacesMakeWallet(context, ));
    }
}
static GlobalMutex g_loading__mutex;
static GlobalMutex g__release_mutex;
static stdcondition_variable g__release_cv;
static stdset<stdstring> g_loading__set GUARDED_BY(g_loading__mutex);
static stdset<stdstring> g_unloading__set GUARDED_BY(g__release_mutex);
static void ReleaseWallet(CWallet* )
{
    const stdstring name = ->GetName();
    ->WalletLogPrintf("Releasing \n");
    ->Flush();
    delet;
    
    {
        LOCK(g__release_mutex);
        if (g_unloading__set.erase(name) == 0) {
            
            return;
        }
    }
    g__release_cv.notify_all();
}
void UnloadWallet(stdshared_ptr<CWallet>&& )
{
    
    const stdstring name = ->GetName();
    {