Check Content Type in Page PreProcess Hook
Instead of looking at the route parameter, you can also do:

$node = $variables['node'];

Here is some example code that I have that is working from preprocess_page:

    $node = $variables['node'];

    if ($node instanceof NodeInterface) {
      $type = $node-&gt;getType();

      if ($type == 'listing_page' &amp;&amp; trim($node-&gt;getTitle()) == 'News') {
        $variables['is_news_page'] = TRUE;
      }
    }


Don't forget your use ... statement if you check node is NodeInterface.

So this is definitely doable - if you are getting any error messages please post them and double check your content type machine names.