One miscalculation can result in them over hiring. Are you suggesting they should have instead every month lay off a few people depending on how the current environment looks instead of 28% at once?
Further in Google’s case they have plenty of money to pay these people until headcount naturally shrinks, but they don’t have anything useful enough for them to do that waiting and avoiding a large severance package is cheaper.
it sounds like greed, not incompetence.
I just do not believe in a worldview where almost all CEOs of large tech companies are incompetent. Whatever the explanation for layoffs is, incompetence ain't it.