And this is why more people should use iOS Shortcuts app to lock the screen if someone opens files, messages, etc.
Shortcuts > Automation (bottom) > + > App > (Choose app you wish to protect, Check "Is Opened", check "Run Immediately") > Next > Search "Lock Screen"