title: Drupal 8 - Custom block is not rendering in controller
body: <p>I have created a custom block and am trying to load it in a controller to ultimately be rendered in a twig template. I know that the block code works, because I can place it on the page using the block ui and the content renders perfectly. But when I try to load it in the controller it returns NULL. Hopefully someone can see what is wrong.</p>
  
  <p>Here is my block code:</p>
  
  <pre><code>/**
   * Provides a 'homepage search' block.
   *
   * @Block(
   *   id = "home_search_block",
   *   admin_label = @Translation("Home Search block"),
   *   category = @Translation("Custom home search block example")
   * )
   */
  class HomeSearchBlock extends BlockBase {
    /**
     * {@inheritdoc}
     */
    public function build() {
      $form = \Drupal::formBuilder()-&gt;getForm('Drupal\homepage\Form\HomeSearchForm');
  
      return $form;
    }
  }
  </code></pre>
  
  <p>And here is my controller code:</p>
  
  <pre><code>class HomeController extends ControllerBase {
  
    public function content() {
  
      $config = $this-&gt;config('nl_admin.settings');
      $image_text = $config-&gt;get('nl_admin.homepage_image_text');
  
      $block = Block::load('home_search_block');
  
      $search_form = \Drupal::entityTypeManager()
        -&gt;getViewBuilder('block')
        -&gt;view($block);
  
      $build = array(
        '#theme' =&gt; 'homepage',
        '#image_text' =&gt; $image_text,
        '#search_form' =&gt; $search_form,
        '#cache' =&gt; array('max-age' =&gt; 0)
       );
  
      return $build;
    }
  
  }
  </code></pre>
  
  <p>If I kint($block) in the controller, it returns NULL.</p>