Pass variables from controller to existing node template file In the Drupal 8 documentation I have found a way how to pass variable from controller to custom twig template

https://www.drupal.org/docs/8/theming/twig/create-custom-twig-templates-from-custom-module

test_twig.module

function test_twig_theme($existing, $type, $theme, $path) {
  return [
    'my_template' =&gt; [
      'variables' =&gt; ['test_var' =&gt; NULL],
    ],
  ];
}


TestTwigController

class TestTwigController extends ControllerBase {
  public function content() {

    return [
      '#theme' =&gt; 'my_template',
      '#test_var' =&gt; $this-&gt;t('Test Value'),
    ];

  }
}


But is there a way to pass variables from controller to already existing node template, for example to node--custom_content_type.html.twig
I believe that node--custom_content_type.html.twig is referring to template overriding.  In template overriding, you are still using the default theme with it's defined variables.  If you are generating the render block in your controller, you can set the variables defined in the default theme. These are generally listed in the default template.

An alternative to passing variables into templates is to use the specific theme preprocess hook. 

Finally, if you set up your local site to deal with debugging twig, you will see information about the template and available hooks for various parts of the output.  See the docs for how to set this up.