I'm unable to access variables in template from preprocess function
You need to apply EntityViewBuilderInterface::viewMultiple before you can render the nodes in a twig template:

$variables['products'] = \Drupal::entityTypeManager()
  -&gt;getViewBuilder('node')
  -&gt;viewMultiple($nodes);


Twig:

{{ products }}


You can add a view mode to viewMultiple() as second argument, for example teaser.