I see plenty of freelance work available, but how much and how well it pays depends a lot on the kind of work. If all you have to offer is a couple of years writing React or installing WordPress plugins the market looks terrible.
At the same time I get small/medium businesses asking for help with cloud infrastructure, security, compliance. Experienced cloud infra people don't grow on trees and the big providers snatch them up. I could probably coast into retirement just tuning relational databases left behind by the "move fast, break things" cohort. Today, in this market, experienced Salesforce and Oracle consultants (freelancers and agencies) can't find enough time or people to meet demand.
The software business follows trends and fad and fashion, and developers follow along. I wouldn't call that a cycle, it looks more like the constantly-changing fashion of teenagers. Look back a few decades and see what has lasted a long time (Unix/Linux, relational databases, system administration, networking, C-family languages, security) and make some of those the foundation, rather than whatever has buzz on Hacker News this week.
Anecdotally when I talk to or read posts from young developers, sometimes recently laid off, about how they can't get a job or break into freelancing, a few things stand out:
- Few or no professional contacts.
- Limited tech skills, often just one language and framework.
- No business domain expertise.
- Thinking in terms of what they want/need rather than what their potential employers or customers might want/need.
That's what happens when you follow fads to the exclusion of everything else, and just want to get left alone to code and ignore the business that writes your paycheck, and make fun of the people in management and marketing and other departments for calling too many meetings or socializing around the proverbial water cooler.