How to render HTML from variable
You should definitely NOT put HTML into render arrays (I'm not saying you cannot (you can with #prefix and #suffix), you just shouldn't - that's D7 thinking). You should define a theme hook/template for that so that you can use your own template. But if you have to use inline template:

$page['noscript'] = [
  '#type' =&gt; 'inline_template',
  '#template' =&gt; '&lt;noscript&gt;&lt;div&gt;{{ message }}&lt;/div&gt;&lt;/noscript&gt;',
  '#context' =&gt; [
    'message' =&gt; $noscript_message,
  ],
];