I apologies before I start this question is vagus and I don't have any code to show as I'm working locally.
I have a Wordpress Multisite, with 3 sites - 'site-1', 'site-2', 'site-3'.
They all import the same nav 'nav-section.php' from a templates folder.
The nav is hard coded but dynmically pulls content from 'site-2' for the the site-2 button
At the start of 'nav-section.php' I get the current blog id then switch to 'site-2'.
$the_blog_id = get_current_blog_id();
switch_to_blog(2);
In 'nav-section.php' I create the nav and pull content from 'site-2'.
At the bottom of 'nav-section.php' I switch back to the current blog
switch_to_blog( $the_blog_id );
On each site I check the switch to blog has worked with
echo get_current_blog_id();
This gives me the current blog id for each site and on every site it is correct.
Each site has pages that pull content from custom fields on that site.
On 'site-1' and 'site-2' the content from the custom fields is not being pulled through but on 'site-2' it is.
If I remove the switch_to_blog(2) in 'nav-section.php' the dynamic content is not added to the nav but the custom field content appears on all pages correctly.
I can only think the switch back to the current blog is not working.
I know this is vague but does anyone have any experience with WP and blog switching.