Do you have a source for this? As far as I know, it's at best a legal gray area. I believe in most cases you'll still be held in contempt of court for not producing secrets needed to access information which the authorities have a warrant for.
Additionally, it's a bit silly in the context of email since the authorities will obtain it from the service provider anyway.
That said, you can still add an encryption key to your phone and you're back to "knowledge based" with the additional caveat a thief would also need the hardware as well.
That's heavily dependent on which country you're in. In France[1] it can go up to 5 years in jail for refusing to provide a password. In the US[2], it seems that passcode are protected since you may be self-incriminating but FaceID, passkeys and fingerprints are not. UK seems to allow police to require you to give your password under their anti-terror laws.
The real answer is you shouldn't tell law enforcement anything without an attorney present, and the best advice would be to heed your attorney's advice on the matter for whether you personally should give up your passwords or not.
Additionally, it's a bit silly in the context of email since the authorities will obtain it from the service provider anyway.
That said, you can still add an encryption key to your phone and you're back to "knowledge based" with the additional caveat a thief would also need the hardware as well.