I’ve taken my iPhone to a couple of repair shops. They always ask for the pin code and I always refuse and say it’s a work phone. Very much hoping the secure enclave works and my data has not left the phone.
After reading far too many similar stories to this one, I've always made a fresh backup and completely wiped my phone before walking into the store. Any testing they need to do can be done on a factory default installation, and restoring from backup is relatively painless these days.
The official repair shops that Apple Repair will guide you to should never ask for the pin, afaik. There is that mode for diagnostics which you need to approve, but you don't need to provide the pin - just unlock the phone and press approve button yourself.
Even when I took my phone into a third party repair place for a new screen they required me to give them my passcode and disable Find My Phone. Seemed super unnecessary.
I used to work as a certified apple tech. Turning off find my iPhone is standard procedure for every repair. But techs are never supposed to ask for your passcode. Most diagnostics can be performed outside the OS, and those that can't are supposed to be performed in front of the client.
Even the Apple store does this when you take your phone for repair. I only did it once and they did a crap job anyways (screen replacement, and they got dust in the camera lens area somehow).