Companies that are wasting their capital will do layoffs. That includes people working at profitable companies who happen to be working on projects that either don’t make sense or are not financially viable.
Most of my friends who got laid off said they were working on these types of projects, so obviously anecdotal. I was curious so I asked them.