The difference is, one doesn't have to cooperate with a search warrant. The idea of encryption being a lock like on a locked door is ludicrous and downright dangerous. Using a fantasy metaphor in place of actual reality is incredibly misleading and outright manipulative.
The difference between a lock and encryption is that all locks in the physical world can be broken by outside parties. If someone doesn't want to open the door for a search warrant, the cops can bust it down. That can't be done with encryption. The only metaphorical equivalent to breaking encryption would be to brute force it which, given proper encryption, is unlikely to succeed. So now we have an innocent person being held indefinitely based on some metaphor the courts decide must hold up in the real world that has no real world basis in reality. Instead of the courts logically following up their own thinking, they now expect the defendant to do the police and prosecutor's work.
If it's a lock, the police/prosecutor should break it after obtaining a warrant. It's not the defendant's job to testify and give them the information they need to break it. If they are incapable of carrying out their job, why should the innocent defendant be compelled to do it for them?
Why should the innocent defendant be made to languish in jail indefinitely because the police/prosecutor are inept and incapable of doing their job without reverting to unconstitutional tactics?