We appreciate you keeping us updated Keithb8ker,
To clarify, you mentioned that the iPhone is becoming unlocked in your pocket. From what you've described, it sounds like the iPhone screen is turning on, but something in the pocket or external stimuli is causing input on the keypad on the iPhone screen. When a passcode is entered incorrectly too many times, your iPhone becomes unavailable instead of unlocking the device. You can read more about that here: If you see an iPhone or iPad unavailable message or Security Lockout screen - Apple Support
That being said, does this typically occur after receiving a notification, such as an incoming call, message, or from an app? If so, this may be why the screen is turning on.
You could test this by turning on a Focus such as Do Not Disturb, then placing the iPhone in your pocket with the screen locked and turned off. If the behavior still occurs, we'd suggest reaching out to Apple directly to isolate further. You can reach them using: Get Support
Have a great day!
Cheers!