Okay this is possible, but not in this way.
We can set other conditionals in the PHP here based on anything we are aware of when the data leaves the server. So, if a certain user role then lock the template. That’s possible.
Jason Bhal, creator of WP GraphQL shared a ghist that shows how you can hook into this.
Not sure if this is over your head for implementing? You can ignore the graphql bits.
In the big picture, the ability to control templates from the PHP is going to be limited to things you can detect at the time that hook is being called, which doesn’t yet include page template (I don’t think) and certainly wouldn’t allow for changes if someone changed the template in the editor.
Hope this explains a bit!