Maybe it's a difference in our interpretations as to meaning of "criminals who are legitimately guilty will walk". That doesn't necessarily imply a prison sentence - it implies a conviction irrespective of what the actual punishment is. The iPhone encryption argument isn't about which crimes deserve which punishments; it's about being able to gather evidence to present in court.
That's kind of like saying that it's fine to provide rope to someone you know is going to use it for a lynching because you like knots and you want to encourage people to tie knots.
Moreover, it doesn't change much when you substitute a different punishment. You don't ever want to be in that situation because you only get there after you've already failed to deter the crime. If the efficiency of your coroner's office seems like a problem, that isn't your actual problem.
No, it's kind of like saying that people should only be convicted in a court of law when the prosecution shows all available and relevant evidence to convince a jury of their guilt, and if convicted the punishment should fit the crime.
Again, you're suggesting that criminals shouldn't face punishment because it's society's fault that the crime wasn't deterred in the first place.
What I'm saying is that the percentage of criminals who are actually punished has very little practical effect. It doesn't affect deterrence because the other prospective criminals never know about it either way. It won't make any particular criminal's victims whole either way (if anything it makes it worse by reducing their ability to pay restitution). It doesn't reduce recidivism.
It's not that we shouldn't try to do it. It's that failure is mostly irrelevant.