From the pictures of the Model 3 production line and Elon Musk's statements it seems that they are going for a step change in the level of automation on the line when compared to other car makers.
This requires a vastly different and incredibly complex system to back it up.
All the fuzzy stuff that we humans do without thinking needs to be programmed into the system.
As someone who has spent almost all my working life doing this stuff, I find it next to impossible to believe that Tesla 're-wrote' the system that was failing to deliver in such a short time AND to test it AND put it into work on the Model 3 line.
If this was the case then I am not surprised that a good few of those laid off recently were probably suffering from burn out. I've seen this before in US Companies operating in their own backyard. They work you until you drop and then you are let go. One reason is because the company does not want to pick up the healthcare bills for your recovery.
A relative of mine moved his whole family to the US and then three months later he was let go for no (to me) reason at all. He spent close on $100k in legal fees before the company settled. Five years later, they were still battling in court over costs. He eventually got them all back but he was broken by the whole experience.
Several of those 'let go' recently had no black marks on their employment history at Tesla. That's why a good number of law suits have been filed already.