LoadChainTip requires cs_main to be locked. Under some conditions, it may call ActivateBestChain. However, ActivateBestChain requires cs_main NOT to be taken when called.
{
    AssertLockHeld(cs_main);
    std::vector<uint256> vHashUpdate;
    
    
    
    
    
    
    auto it = disconnectpool.queuedTx.get<insertion_order>().rbegin();
    while (it != disconnectpool.queuedTx.get<insertion_order>().rend()) {
        
        CValidationState stateDummy;
        if (!fAddToMempool || (*it)->IsCoinBase() ||