To be accurate Elon AFAIK did not ascribe causality. He, as we all, can ascribe any given outlook to disparate causes. A not very robust examination of macroeconomic issues makes a broad expectation of a recession in the US sometime in the next two years a >50% probability, and worse than a mild recession a possibility too. Elon was not specific.
@Artful Dodger points quippy to past accuracy of such prognostications. We all should know by now that Mr. Musk does a really good job of evaluating contingencies and devising alternatives to cope for a wide variety of negative outcomes. That is prudent.
We all should also recognize that sound contingency plans are quite wise when uncertainty rises, as it is doing right now. Hence it is a real excellent idea to avoid speculative moves now when risks are very high. If we consider one thing only...extreme climate events are threatening all our expectations. How we do not know, but we do know the economic consequences can be and are being catastrophic. Then think of public health risks brought about by the same issue, ranging from viruses, bacteria, crop failures, animal husbandry crises, and so on.
To be candid, recession itself is not the central question. The central question is extreme climate events and closely related extreme political reactions. Think clearly and we'll all understand that most refugee crises are driven by food and shelter collapse in major parts fo the world, which in turn yields political collapse.
So, when Elon Musk made that single economic comment he was summarizing all the above and much else. His comments are quite closely related to the urgency he has to help make humans a multi-planetary species.
In sum, after one has lived through quite a few recessions one ends out judging when the risks are higher. When that appears to be the case there is one rule that supersedes all others: When risk rises cash is king!
During the last few months I have steadily reduced risk in my own investments. At the moment my only non-cash-yielding investment is TSLA. I will not liquidate any TSLA. For the first time in a couple fo decades I have no cross-border risk exposure, meaning I am 100% covered, so values can change but my obligations are now unaffected by that. This is not advice! I have neither license nor inclination to offer investment advice.
That said, I strongly advise reducing risk now. For the record, recessions almost always are directly signaled with failures of speculative entities: market markers, injudicious banks, derivatives traders, etc. When that begins to happen we will know that a recession has begun, and numbers will reveal that a few months later. It is always thus, since Tulip Mania and before. In our own arena look for Nikola, for one, and other serious speculations to 'suddenly' fail. Look at leverage.
For quick and easy reference have a quick look at the most recent one, from 2008. That coincided nicely with the .com mania.
Tesla knows what is coming. That is why Tesla is cash generating and has zero short term debt and little long term debt. After all lack of cash is what drives failure, for everyone and everything.