Sounds like this is something developers bake into their apps, not something the phone enforces.
ie, if I develop an app, I can have the app check a special google "Integrity" API and if I get no response (or a negative response), just have the app close.
This is exactly what it is. It is not enabled by default, a developer has to specifically enable it. Meaning the developer wants to force you through the Play Store for whatever reason they may have.