How do I place a block in a region, programatically? Why isn't my custom block rendering in the region I want? It shows in the content region, not my custom content_right region. 

function bootstrap_preprocess_html(&amp;$variables) {
  if (\Drupal::routeMatch()-&gt;getRouteName() == 'some.path') {
    $block = \Drupal::entityManager()-&gt;getStorage('block_content')-&gt;load(12);
//kint($block);
    $block_view = \Drupal::entityManager()-&gt;getViewBuilder('block_content')-&gt;view($block);
    $variables['page']['content_right']['custom_block'] = $block_view;
  }
}


What am I missing?
You can try this, create an instance of a block plugin on the fly for the block content:

$block_content = \Drupal::entityTypeManager()-&gt;getStorage('block_content')-&gt;load(12);

$plugin_id = 'block_content:' . $block_content-&gt;uuid();
$block_view = \Drupal::service('plugin.manager.block')
  -&gt;createInstance($plugin_id, [])
  -&gt;build();

$variables['page']['content_right']['custom_block'] = $block_view;


But it's better to configure the block plugin in UI and build the configured block instead. For more info see this question Programatically render a block in a twig template