There's a limit on the number of tries you have to "repair" the paint job, because the vehicle has to go through the oven again to bake the coatings. The trips through the oven affect more than just the paint. Some panels are filled with foam; there's internal sealant and glue, and external sealant. All of those things don't really love being baked too long. For the shop I worked in, we got 2 tries to repair.
The main limit on repairs though? The windshield. Windshields are glued in with specialized urethane 'caulking'. They have to stick to the paint, and the paint has to stick to the body. That is only certified reliable with less than 5 trips through the ovens (in my shop).
---
Paint is the hardest thing to get right in the whole assembly process, because there are so many process variables. Temperature and humidity (dew point) are the biggest besides the actual paint mix, but there's also unexpected problems from every direction. Our solvent paint process (pre-2013) was very vulnerable to siloxane (silicone) lubricants. Someone in IT applied some lubricant to a label printer and ruined hundreds of paint jobs. Livestrong bracelets also ruined at least a hundred paint jobs. Someone did weekend work on the roof? Congratulations on your dust quality spill (spill means a bunch of problems).
All of the parts of the paint have to work together, and that includes things that you don't think are paint. The body is just dumb metal, right? Of course not. The metal panels have oil on them in stamping, and they MUST stay oiled right up to the point where the body takes it's first bath. If too much of the oil has evaporated, then you start getting corrosion, and in many cases you won't be able to tell until the vehicle gets to the customer.
---
Paint shops have the most complicating routing of any part of automotive assembly. The electronic quality and build data has to be synchronized with the physical process, and that data package can be updated by several different systems. Then either IT or OT (operational technology) can make a routing decision, or an individual can use a key switch to manually change routing. "Why did this vehicle go here" is not a straightforward question to answer sometimes.