Why is gold a safe haven investment?
You could see it as a coordination game and an example of a rational bubble. Because everybody knows that people start buying gold and the price goes up when the economy tanks, it is actually a good strategy to do just that. Similar things happen for example with the Swiss Franc.
The idea that the stock of gold is fixed and hence its price is stable, is empirically just plain wrong.
First, gold production varies with production cost and the demand for gold, just as in other industries. It is also dominated by a couple of countries and big mining companies with tons of market power.
Second, the price of gold is highly volatile, just as other commodities. The standard deviation of gold prices is much higher compared to for example Treasuries or G7 countries' equity indices.