Display custom variables
The variable you are looking for is not ns_custom_template but test_var

To get all variables in your twig file, you can try {{ kint() }}

To get the variable you have previously declared in mymodule_theme, you can try {{ kint(test_var) }}

BUT there is another mistake:

The twig file in which you will find test_var is not node--page.html.twig but only ns-custom-template.html.twig

if you want to have test_var inside node--page.html.twig, you can use a preprocess function : function template_preprocess_node with a code like:

$var['test_var']='my value';


EDIT:It seems that you would like to use the template ns_custom_template in a node template: to achieve this, you need to populate your variable test_var with a render array having the name defined in mymodule_theme as a value of the #theme key.

function mymodule_preprocess_node(&amp;$var) {
  $var['my_free_var_name'] = ['#theme' =&gt; 'ns_custom_template', '#test_var' =&gt; 'your value'];
}


After doing this, you can display your template inside node--page.html.twig bu using the following code:

{{ my_free_var_name }}