Restricting/Blocking iPhone access with a passcode for workers?
Apps can not do this on iOS due to how the OS restricts an app to the sandbox. However, this is precisely what an MDM does.
You need no app whatsoever on the iOS side - just a profile and an identity to get Apple to recognize your authority and for each device owner to accept your MDM profile.

https://support.apple.com/en-us/HT202804

If you are a company that owns the devices - you will want to use Apple Business Manager and then work with Apple or someone else to shop for and set up the best MDM for your size. There are some great for 5 devices and some great for 50,000 devices.

https://support.apple.com/business

If you are a service provider, you also can learn about MDM and then offer it to clients. If you’re a developer, there are open-source MDM frameworks so you can learn if you want to build a better wheel.

https://micromdm.io/

Most of the professionals that manage mac and iOS devices congregate under the MacAdmin community, so reach out if you need help managing your devices or are just a highly motivated learner.

https://www.macadmins.org/