bloginfo(); outputs wrong urls without https on inner pages
According to documentation, get_stylesheet_directory_uri() should check for SSL while retrieving the theme directory url. Try exchanging <link rel=”shortcut icon” href=”https://wordpress.stackexchange.com/questions/307203/<?php bloginfo(“template_directory’); ?>/icons/favicon.ico”> to <link rel=”shortcut icon” href=”https://wordpress.stackexchange.com/questions/307203/<?php echo get_stylesheet_directory_uri(); ?>/icons/favicon.ico”> in your header.php file.