How do you propose you fix that and still keep shady refurbishers from selling stolen phones? Even if the refurbishing company is trustworthy what is to guarantee that all of the employees are and they don’t get kickbacks for mixing in stolen phones with the legitimate ones?
This isn’t far fetched. Many SIM swaps are done by employees of carriers taking bribes to help thieves perform SIM swaps. They aren’t all done by social engineering.
Now suppose none of that occurs and Apple unlocks phones. Now a phone that has user data on it that was formerly encrypted is available to a third party.
Yes Apple could perform a remote wipe, but again why would Apple want to get in the middle of that? What if someone was being malicious and copied someone’s serial number and asked Apple to do a remote wipe?
Long story short, if the phone wasn’t unlocked before it was given to the refurbisher, you have know way of knowing whether the phone was stolen.