Your understanding of the classic gold standard is flawed.
First, in the long run the value of gold had been rather stable. That's because the supply of gold isn't random: it takes effort to mine gold. If the gold price is higher than usual for a longer time, people will put more effort into mining. (More formally: even more marginal mines will be worked.) Similar for periods of low gold prices.
Of course, these adjustments happen over long time periods only.
Second, in anything but a very naive gold standard the amount of gold in circulation doesn't need to reflect the size of the economy. At least not directly. Gold was mostly a unit of account, but people seldom exchanged physical gold coins. Which fractional reserve banking, there's no simple relation between the amount of money in an economy and the amount of gold, even if every note is redeemable in gold on demand.
During its free banking era, Scotland was famous for having both a very strong and stable banking sector (one of the reasons it manage to mostly catch up with the England during the Industrial Revolution), and also scarcely any gold in the country.
In Scotland during that time, typical banks held about 2% of their as assets as gold reserves, the rest was invested in the real economy. However, they also had much thicker equity cushions than was is common today: about 30% instead of 8%. That's equivalent to saying that Scottish banks were much less leveraged.