There is no profit, expense, revenue. Those don't matter. Only thing that matters is stock price goes up, and laying off makes stock price go up. When laying off make stock price go down, then laying off stop.
I imagine layoffs are also very much "this quarter and next quarter" with regards to investor visibility.
While LLM Opex is "some future quarter" and very easy to co-mingle with other expenses.