The money wasn't only spent on Powertrains. I think Tesla just doesn't give a AF if there are production issues because they run their lines so fast.
Here's an example of what automakers have been using during assembly for the last decade. It's not for luxury automakers anymore... even a Hyundai Accent from 2013 will have better panel gaps than a Tesla because Hyundai will attempt a remedy on the line instead of just pounding out stuff to turf over to PDI or an after-sale repair with a CS/tech.
Prior to robots, there were hand-held physical tools being used. Either way the automaker just need a mechanism so that if a bad measurement is identified, someone then needs the wherewithal and time to make an adjustment. I think Tesla just stopped caring and set their tolerances super wide to make sure their line wasn't slowed down. But that also puts Tesla fit and finish somewhere below a 1990's Daewoo. Maybe a car will roll off the line looking good, but they also allow cars to roll off the end-assembly line looking like crap.