Every device will most certainly be connected to a system that will configure the device and check for hardware faults....and that manufacturer's employees inspect each and every device. They don't just assemble these things and then throw them in the packaging without checking if they even turn on. That's also why there's always people asking why their brand new Apple product already has a battery charge cycle showing, or two, questioning whether it's even new - at least on the Macs where you can easily see the amount of cycles.
Not catching visible scratches like we see in this thread, or even dents, is simply a QC issue.
If this was the old base iPad on a special sale I might accept it, but on a flagship device for 1k and more I really don't think so. Buying Apple refurbished doesn't resolve the issue since the prices in the Apple refurb store are usually on par with what the same device costs brand-new via some retailers. At least for some devices and configurations that's the case. Apple refurbished devices have to be at least somewhat cheaper in order for me to consider them at all.
For example the 14" MBP base model was available for 1599 before tax from a few places all throughout September. Apple sells that same model -refurbished- for 1709 before tax. Buying refurb rarely makes sense, except for the most expensive configurations that many retailers don't have in the first place. For the iPad Pro that is not relevant since all configurations are offered by many retailers.
Every device will be checked visually checked for defects too.
However there will be a pass/fail criteria of what is acceptable for blemishes and aesthetic defects. It would be crazy not to as the more you reject at QC the greater the cost of the ones you need to sell as you need to price for the rejections.
Getting the balance right isn’t easy, but it’s never going to result in all devices coming off a production line flawless for sale.
Also consider that visual inspections will be done before the device is powered on and tested (otherwise you’re wasting time testing a device that won’t leave the factory). Though it may get a secondary check on packaging.
So while I disagree with your implication that all visual defects should be rejected. It 100% does not excuse the marks on OPs Smart Connector which in my opinion should 100% have not made it out of the factory.