
The reason for this many layoffs worldwide?

There is one more reason (most companies will not acknowledge openly). It is in fact a combination of the last two reasons. All organisations that experienced high growth would have hired extra resources at a high cost (relative to quality). Now that the talent market is down, they want to eliminate high cost resources and replace them with equally good / better resources but at a lower cost. It is the buy low sell high strategy in reverse.

Sab Behari Ganga mein haath dho rahe hain.

I am shocked how profitability and lack of product market fit sn't a part of the options

Ex founder here and sharing perspective based on my experience. The last two years had crazy money being pulled in, everyone was busy building tech and no one really cared to sell since cash burn was an option. Now when the VC funds have dried up and monetisation/path to profitability are important discussion points (infact a point of survival), most companies who raised a lot and hired a lot of people at inflated salaries are now laying people off. Their focus is now on selling and techies would bear the blunt in this environment. Not a lot of jobs would be there in the market and there is a good chance you'd be making less than what you're making right now (esp if you were hired during the 2021 hyper funding wave).
This is the root cause of most layoffs. Most startups who were thoughtful during the team building/hiring process won't be laying off a lot of team members.

Lack of funding and Excess hiring in the last 4 years

It’s not just engineers!

Additionally, most companies don't exist in a vacuum. There's a vicious cycle as companies cut their spending due to lower forecasts, to their vendors having lower forecasts as a result and so on.
Though there's a cynical part of me which also feels there's a little bit of FOMO that Elon unleashed with how he went about the initial layoffs at Twitter.