How to display a block in twig (D8)
To make the form variable available in the Twig template you need to supply a context like follows.

$build['page'] = [
  '#type' =&gt; 'inline_template',
  '#template' =&gt; $template,
  '#context' =&gt; ['form' =&gt; $block_content],
];


Generally, I would recommend using custom #theme hook instead of an inline template.

Another way to render block within a template is using Twig Tweak module.

{{ drupal_entity('block', 'block_id') }}