Absolutely, the idea of "coercion codes"/"distress codes" or the like goes back a very long time, long before electronic devices even, it's a pretty natural idea that someone could use different canned expressions to code for different responses that attackers wouldn't be able to distinguish. All the core aspects are in place on iOS to do a system both user friendly and quite powerful around that, and years and years later it remains too bad that's hard. In fact in a touch of irony it was at one point quite feasible and pleasant to do with a jailbroken iPhone and Touch ID. The Touch ID system actually distinguished between the various registered fingers (up to five), which in turn meant you could use fingers themselves to trigger other behavior. So "unlock with either index finger" could be "normal", but "unlock with thumb" or middle finger could then run scripts of your choosing in the background.
It would be a real boon if Apple themselves did it, incorporating not just codes or biometrics even but also arbitrary information from phones sensors if advanced users wanted. So for example you could explicitly set a few geofences and say that certain actions could only be done within them (and only at certain times of day even), or certain apps viewed at all (by literally keeping the encryption keys for them locked away unless all conditions were met). If it's not even possible for you to comply when traveling in the first place and that's widely known and transparent it reduces the value in trying to coerce you.
Such a system could also be useful outside of security fwiw, just in ordering our lives. Someone finding distraction hard could lock all their games and social media apps in a view accessible only at home and forbid any app store purchases as an aid in avoiding temptation. Anti-engagement instead of trying to get more engagement.