For most, if not all uses in electronics, gold can usually be substituted for other metals. Also, globally, only about 10% of gold is used for electronics.
It's also not the best investment when compared with stocks' total return index (appreciation + dividends)
https://www.longtermtrends.net/stocks-vs-gold-comparison/
(scroll down to the 2nd graph)
It's clearly not the best choice as an investment, but it's OK if used as a store of value when everything else goes to shit.
'Everything going to shit' is also something central banks should be preparing for, no one can tell if the anticipated slow down of growth in the US isn't going to turn into one black swan of a recession. A potential Eurozone crisis is also something to be wary of.
https://www.bloomberg.com/news/articles/2019-05-02/central-bank-first-quarter-gold-buying-at-highest-since-2013