It's crazy that a repair shop needs your passcode. I can't think of any case where it would be necessary.
I'm glad this person won the lawsuit though; getting your nudes leaked is a really shitty situation to be in. Apple needs to do a better job vetting their repair shops.
The problem is that Android doesn't offer a pre-boot UI for testing anything unless you flash TWRP (at which point the userdata will be wiped), and I'm not sure if iOS does either.
Often not even that. Samsung wants its proprietary Odin stuff to flash, Mediatek has their own toolsuite. Both need Windows to run.
Only ones actually using fully open source tools are Google's Pixel lineup.
But none, not even Pixel, allow for anything resembling actual "recovery" for common failure modes. Dead display at least for Samsung and Pixel means you have to install a new display if you want to access the data, otherwise it won't even pass the first bootloader stage, much less boot into the OS or unlock the encryption. Something gone corrupt with the OS? Same case. If you can't manage to boot at least to the Android Safe Mode, you're out of luck. And no HW self-test at all.
I'm glad this person won the lawsuit though; getting your nudes leaked is a really shitty situation to be in. Apple needs to do a better job vetting their repair shops.