How to load node object in node preview page?
If you need to use the node object in hook_preprocess_page() on the preview page, you need to use the "node_preview" parameter, instead of the "node" parameter:

function mymodule_preprocess_page(&amp;$vars) {

  $route_name = \Drupal::routeMatch()-&gt;getRouteName();

  if ($route_name == 'entity.node.canonical') {
    $node = \Drupal::routeMatch()-&gt;getParameter('node');
  }
  elseif ($route_name == 'entity.node.preview') {
    $node = \Drupal::routeMatch()-&gt;getParameter('node_preview');
  }