Worked at a couple FAANG companies and from what I've seen, management is absolutely right that remote work, overall, is inefficient. There was a Blind poll and I believe half the people admitted they were slacking off more frequently while remote. However, being laid off is just a completely different matter. Depending on the company, the motivation for the layoff could significantly differ. Some did it to save cost…
Slacking off but then returning to focused, deep work, without distraction can absolutely be more productive than working consistently in a distracting environment. I've even found that "slacking off" is embraced by companies who have worked remotely. In one prior gig, letting the team know, "Hey, I'm going skiing for a couple hours and will be online this evening" was not at all an unusual message to see. People work when they are going to be productive and "slack" when they wouldn't be productive anyway. Remote work means you can optimize for your personal productive times... and still slack off more. Best of both worlds.