Maybe so. Although outside of the US (Europe for instance), businesses are not so trigger happy that they lay people off every other month.
When a company must do budget cuts and layoff, it’s a big deal once in a few years thing. Not bi-annually.
Whatever the frequency is, it’s a risk. Arguably though if you’re remote you’re getting paid HCOL wages while living in a lower COL area, so being laid off isn’t as much financially dangerous as it would be in SF/NYC. Plus all these working years you’ve avoided the stress and drama that goes with climbing the ladder/getting in your boss’s pocket.
Not sure why you’re getting downvoted though, it’s a legitimate concern.
Like I said. This isn't everyone's cup of tea. I'd rather be unemployed than grovelling to my boss and play the climb the ladder game. That's me. You do you.
Developers are in the 1%. A good dev is always going to find work, at least for the foreseeable future. There is a huge scramble to snap up newly redundant talent now. I had a dev who lost their job reject a job offer today because another company got there first. I know what job he took but he doesn't know I know so it's not like he said it to soften the rejection.
(I find it amusing that this was downvoted when it's basically an axiom :-) )