Settings >Accounts >Sign-in options > Additional settings > Dynamic lock - Disable the check box
"Allow windows to automatically lock your device when you are away"
Hope this will fix your issue.
If the reply is helpful, please Upvote and Accept as answer
Thank you