My guess at the crossover point of "overly confident we knew what we were doing" and "contractor screwed the pooch" narratives is that Tesla spec'd the system they needed and then assumed the contractor was delivering, and spent so much time focusing on all the other stuff for Model 3, assuming that module assembly was "done", that they never closely checked on the contractor.
If the contractor had told them honestly they were having problems, I'm sure Tesla would have focused some energy there (*surely* they wouldn't have ignored such reports?), but they probably just took no news as good news and assumed it would hit the ground running, and instead, it was completely busted. They should have kept a closer eye on their contractor's progress, thus been able to take corrective actions sooner (whether it be getting the contractor to fix things ahead of time or simply ditch them for someone else as they eventually had to do with the acquisition of Tesla Grohmann).
I'm not sure if they wholly designed their S/X module/pack assembly lines internally or if they contracted that out too - perhaps the same contractor? So they might have assumed it was going to go fine, after having provided the specifications of X goes in, Y comes out. If they had used the contractor before and hadn't gotten any bad news then it would be "reasonable" to assume things are going well, but they should have kept a closer eye on something so critical anyways.
Anyways, the dual stories of "we were too confident we had battery module production solved" and "contractor screwed up" are not at all mutually exclusive. Basically boils down to assuming contractor was delivering on the specifications they asked for (assuming the specs were good - for all we know the specs were bad and the contractor DID deliver... though the phrasing they've used has implied the contractor screwed up), and not checking up on them. Tesla is still somewhat responsible for failure to keep an eye on the contractor, even if the contractor is the one failing to do the work correctly. Had Tesla paid more attention there, they might already be pushing 5K/week (or finding other bottlenecks).
Of course it's also possible that had they solved the battery problem sooner by paying attention to it, that 20 other bottlenecks might have popped up to surprise them one after another while trying to ramp production... so no one can really say whether or not this was not the best outcome possible for the allocation of resources.