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.
{
        if (m_tx_relay != nullptr) {
            LOCK(m_tx_relay->cs_tx_inventory);
            m_tx_relay->filterInventoryKnown.insert(inv.hash);
        }
    }
    void PushInventory(const CInv& inv)
    {
        if (inv.type == MSG_TX && m_tx_relay != nullptr) {
            LOCK(m_tx_relay->cs_tx_inventory);
            if (!m_tx_relay->filterInventoryKnown.contains(inv.hash)) {
                m_tx_relay->setInventoryTxToSend.insert(inv.hash);
            }
        } else if (inv.type == MSG_BLOCK) {
            LOCK(cs_inventory);
            vInventoryBlockToSend.push_back(inv.hash);
        }
    }
    void PushBlockHash(const uint256 &hash)