Other good points were brought up - why not dismiss the hard drive as evidence and use other “proof” such as network logs, computer thumbnails caches from the defendants personal computer, etc?
Personally I’m not sure if those ideas were ever explored.
https://arstechnica.com/tech-policy/2020/02/man-who-refused-...
There's a further consideration of whether you can refuse if the literal string of the password itself would incriminate you, but I don't believe that has been conclusively litigated.
Also, why don't they just beat the shit out of you to get the key?
It's better to not do or have anything illegal. Make it so you can say "I have nothing to hide", but don't give them access voluntarily because of that.
But they won't risk it for someone with a CSAM match or anything similarly uninteresting, and local authorities won't even be aware that it's something their government can do.
Still, don't do anything illegal, but I think for most people it's legitimate to have a threat profile that assumes that encryption is effective.