When I see things like that, I suspect that's not how the vehicle left the assembly line at the factory.
If you watch drone footage of Tesla factories on YouTube, you'll occasionally see a relatively small number of new vehicles sitting outside with tarps over them. These appear to be vehicles that Tesla built, but did not have the roof glass available at the time of production, so the vehicles were set aside so it could be added later. In this case, it's likely that the adhesive and glass were installed by humans instead of robots resulting in more inconsistency and chance for assembly error.
Vehicles also regularly get damaged in transit from factories to or at delivery locations due to human error or hail. This damage is sometimes repaired and paid for by the shipper and sometimes by Tesla depending on the responsible party. In some states, any repairs performed prior to delivery must be disclosed. In other states, only damage above a certain amount, if any, must be reported.
It's very likely that these types of issues are not acceptable to factory QC and happened beyond their control. It's also possible, but less likely, that they were told, "Ship it as-is and we'll fix it only if the customer notices and complains."