A record gold price is almost always about buyers piling in, not about gold running out. Most of the gold ever mined is still sitting in a vault or a jewelry box, and a new mine takes many years to permit and build, so a rush of buyers cannot be met with more gold. That leaves the extra demand nowhere to go but the price. A record price mostly tells you what savers expect about inflation and how uneasy they feel; it does not cause either one.
A record gold price is almost always about buyers piling in, not about gold running out.
Picture all the gold in vaults, jewelry boxes, and coin shops. The demand curve shows how much gold buyers want at each price, from jewelers to savers buying coins. The supply curve shows how much sellers are willing to part with at each price. Notice that gold's supply curve is unusually steep, which economists call inelastic supply, meaning the quantity offered barely changes when the price does. The reason is physical: the gold already sitting above ground dwarfs whatever any mine adds in a year, and a new one takes many years to find, permit, and build.
Now try it yourself: shift the curves in a graded FRQ drill, or open this graph in the free sandbox.
Some economists point to very long stretches of history in which gold roughly kept pace with the cost of living. Others say its price swings for reasons that have little to do with the inflation rate at the time, so it protects nobody over a few months or years.
More questions like this on the What If hub, or go deeper with the AP graph walkthroughs.