

My take would be using grapheneos and give the duress pin when asked for it, that way if they put the pin the entire phone gets wiped.
I know I’m not answering your question directly but if you use lineageos with an unlocked bootloader the best you can do is deny to give the passcode but eventually depending on their resources they will get in.

If you have something highly illegal in your device I think it is better to be charged for destroying evidence than something worse or even if the police find something that can get you in trouble with someone worse than them.