adding twig variable in html.html.twig from module I'm looking to add a twig variable, which is set in a module, and render it in the html.html.twig template file for my theme.

In my module file I use the hook_preprocess_html() function where I render and set the twig variable like so:

function insusite_cta_bar_preprocess_html(&amp;$variables) {
 $output = \Drupal::theme()-&gt;render('insusite_cta_bar_actions', array('items' =&gt; $itemsOutput, 'panels' =&gt; $panelOutput));

 $variables['cta_bar'] = $output;
}


Then in the html.html.twig template file in my themes folder I simply render the new cta_bar variable like so:

&lt;!DOCTYPE html&gt;
&lt;html{{ html_attributes }}&gt;
 &lt;head&gt;
  &lt;head-placeholder token="{{ placeholder_token|raw }}"&gt;
 &lt;title&gt;{{ head_title|safe_join(' | ') }}&lt;/title&gt;
  &lt;css-placeholder token="{{ placeholder_token|raw }}"&gt;
  &lt;js-placeholder token="{{ placeholder_token|raw }}"&gt;
 &lt;/head&gt;
 &lt;body{{ attributes }}&gt;
  {{ page_top }}
  {{ page }}
  {{ page_bottom }}
  {{ cta_bar }}
  &lt;js-bottom-placeholder token="{{ placeholder_token|raw }}"&gt;
 &lt;/body&gt;
&lt;/html&gt;


This doesn't render anything at all. 

However, if I add preprocess_html() function to my .theme file then it DOES work, problem is we're using drupal as a multi-site system so I'd have to find a way to add this in to every theme's html, is there a way to do this?
Just tested what I can of your code, and this works from a custom module:

function examplemodule_preprocess_html(&amp;$variables) {

 $variables['cta_bar'] = ['#markup' =&gt; '&lt;h2&gt;Test CTA Bar&lt;/h2&gt;'];
}


It then can be output in the theme with this template:

/themes/custom/mycustomtheme/templates/layout/html.html.twig

like this:

{{ cta_bar }}


Of course, you need to register your preprocess function by clearing the cache.

Other than that, I think it must be a problem with your theme function insusite_cta_bar_actions.  Can you give us more info on that?