On iPhone at least when you restart the phone it forces you to use the passcode to unlock the first time. I believe in the US passcodes are protected by the 5th amendment whereas face id or fingerprints are not. So while you can be compelled to unlock your phone with biometrics, you cannot be compelled with the passcode. Your milage may vary in other jurisdictions.