Haven't found something in the forum about this, so I wanted to give a shout out an App I found on F-Droid. It is called Private Lock and can lock your phone via acceleration. You then have to unlock it via code, because biometrics get disabled.
I imagine it to be particularly useful when it is ripped out of your hand by a thief, in which case you wouldn't have enough time to lock it. Or when police tries to take it you just give it a shake and they can't use your fingerprint.
It can be a bit annoying though when you trigger it on accident and have to punch in the code again. Especially if you have PIN-scrambling enabled.
I have been using it for years and love it. Maybe it could be incorporated into GOS natively under the security settings.