I consider that poor advice. Here's why:
My solar investment took risk out of the equation. The investment is way past break even point; it fuels my house (blare the AC in summer) and fuels an EV ($125+ per month). The ROI has far exceeded my expectations. My electricity costs, in a high energy cost area, will continue to be small.
Beyond that, the returns on my portfolio are pretty stout. You might be surprised at the dividends alone.
Putting all your eggs in one basket is not my strategy. My primary strategy was having a place to live in a great area, free and clear, with minimal recurring costs, for the long run. I did everything while I was working. That's insurance against market fluctuations.
The initial solar investment, in the big scheme of things, was peanuts. The deal was too good to turn down. The tax man even helped... All in, sometimes you get lucky. By the way, there's a lotta sun right now. My average bill, with all costs, is probably more like $30. I don't bother to pay attention; no reason.