Gold's "safe haven" credentials and its correlation to equities are not necessarily quite the same thing.
Gold is a safe haven, in the sense that whatever happens in the economy, an ounce will always remain an ounce. It remains gloriously unchanged, whatever else happens around it. Which is why asset allocators often think about it as akin to a perpetual zero-coupon inflation-linked bond.
So its correlation to equities is really telling you more about equities than about gold. Gold is gloriously unchanged, whatever happens; so all the price movement that generates any correlation is really a story about what moves equities, such that they are independent of gold (as opposed to negatively correlated).
In essence, this becomes a story about real interest rates, which is a broad proxy for the cost of capital. Higher real is the kiss of death for gold, because I can buy positive-yielding inflation-linked bonds that give me a coupon that gold does not offer. And vice versa. The question is how stocks respond to the same. Higher real might mean a booming economy, and thus booming profits. Good for stocks. It might mean a tight monetary policy that discounts profits (from an unchanged economic growth rate) more aggressively. This would be bad for stocks. XYZ's profits might be 10% higher in a decade's time; but if the aggregate interest from now to then is 20% higher, those future profits will be worth less today.
So the stock:gold correlation is really a proxy for whether it's the economic hot/cold versus the financial loose/tight that's driving stock prices. In recent years, no surprise, it's the financial>economic that wins, hands down.
hope this helps.