Restricting page templates by blog_id in multisite network

I know it is a bit old question. But I hope some one can find it usefull.
If for some reason you can’t use child-theme (like me) there is hook theme_page_templates Accordint to developer WP Page Templates.
Example:

function makewp_exclude_page_templates( $post_templates ) {
  if ( is_multisite() && !is_main_site() ) {
    unset( $post_templates['wp-templates/iframe_container.php'] );
    //In my case this one is removed from the list on every page other than main site
  } 
  return $post_templates;
}
add_filter( 'theme_page_templates', 'makewp_exclude_page_templates' );