how do I get the parent node of an entity reference node
You should be able to do this:

$loaded_nodes = \Drupal::entityTypeManager()-&gt;getStorage('node')-&gt;loadByProperties([
  'field_node_reference' =&gt; $node-&gt;id(),
]);
$parent_node = array_pop($loaded_nodes);


Replace the field name with your actual field name.