Is it a good idea for someone in the middle class to invest in physical gold as a safe guard against economic crisis?
No. This is not investing. This is preparing for the worst. Or actually, trying to prepare for the worst. Investing, by definition, requires a fundamental yield mechanism.
Forest grows. That's yield.
Bonds pay interest. That's yield.
Stocks pay dividend. That's yield.
Real estate pays rent. That's yield.
Art, if placed in a museum, pays ticket fees. That's yield.
But what would the yield be for gold? It yields nothing. Gold just ... is. It doesn't become more, it doesn't increase in quantity, it doesn't pay you anything regularly.
If you want to prepare for an economic crisis, I would recommend to:
Prepare an emergency fund of highest-quality bonds in your local currency. This prepares you for anything excepts inflation. Avoid corporate bonds, avoid long bonds, avoid anything suspicious. In this market situation (low interest rates), I would recommend as short bonds as possible. Bank account deposits could be a good option for bonds.
Invest into stocks of companies which produce products that will be needed too in an economic crisis. They are often called consumer staples, as opposed to consumer discretionary. For example, automobiles are consumer discretionary, but food and beverages are consumer staples.
If you absolutely must invest into gold and cannot sleep during the night without substantial gold investments, buy shares of a gold mine instead. Unlike physical gold, the gold mine has a yield mechanism. However, when doing this, you must keep in mind diversification. A suitable investment for gold mine would be proportional to the share of gold in world economy, which is to be honest, pretty small.