Passing Information to Drupal Referenced Entities before Render
This works as designed. The referenced node can have multiple parents, but is only processed once and then cached.

A slighly different approach would be to use the context to check inside the referenced node, which parent node is displayed as page content.

Load the basic node with a route match in preprocess of the referenced node. See this question from today on blocks, which can be used in the node preprocess hook in the same way: 

How to access field values from a custom block

You would also have to adjust the cache settings of the referenced node, see the comment in the linked answer.