This is a well known (long standing) issue. Documented in the code base in commit eea02be70ee37b845f2719b3c08e5baf4b6f51f6.

Countless intermittent sanitizer warnings can be attributed to it.
for (const CNode *node : vNodes) {
        BOOST_CHECK(node->fDisconnect == false);
    }
    
    
    
    AddRandomOutboundPeer(vNodes, *peerLogic, connman.get());
    peerLogic->CheckForStaleTipAndEvictPeers(consensusParams);
    for (int i=0; i<max_outbound_full_relay; ++i) {
        BOOST_CHECK(vNodes[i]->fDisconnect == false);
    }
    
    BOOST_CHECK(vNodes.back()->fDisconnect == true);
    vNodes.back()->fDisconnect = false;
    
    
    UpdateLastBlockAnnounceTime(vNodes.back()->GetId(), GetTime());
    peerLogic->CheckForStaleTipAndEvictPeers(consensusParams);
    for (int i=0; i<max_outbound_full_relay-1; ++i) {
        BOOST_CHECK(vNodes[i]->fDisconnect == false);
    }
    BOOST_CHECK(vNodes[max_outbound_full_relay-1]->fDisconnect == true);
    BOOST_CHECK(vNodes.back()->fDisconnect == false);
    bool dummy;
    for (const CNode *node : vNodes) {
        peerLogic->FinalizeNode(node->GetId(), dummy);
    }
    connman->ClearNodes();
}
BOOST_AUTO_TEST_CASE(DoS_banning)