Variables injected or set in a Twig file are undefined after the first position of an entity reference field
Based on the comments to the question, I extended the EntityReferenceEntityFormatter class and modified one part in the viewElements method (the rest is the same):

  $view_builder = $this-&gt;entityTypeManager-&gt;getViewBuilder($entity-&gt;getEntityTypeId());
  $elements[$delta] = $view_builder-&gt;view($entity, $view_mode, $entity-&gt;language()-&gt;getId());

  try {
    $parent = $items-&gt;getParent();
    $parent_entity = $parent-&gt;getValue();
    $elements[$delta]['#cache']['keys'][] = $parent_entity-&gt;id();
    $elements[$delta]['#cache']['keys'][] = $parent_entity-&gt;bundle();
    $elements[$delta]['#cache']['keys'][] = $parent_entity-&gt;getEntityTypeId();
    $elements[$delta]['#cache']['keys'][] = 'context_aware';

    // Add special information for different paragraph types.
    if ($parent_entity-&gt;getEntityTypeId() == 'paragraph') {
      if ($parent_entity-&gt;bundle() == 'homepage_feature') {
        $elements[$delta]['#style_flags']['top_image'] = FALSE;
        $elements[$delta]['#style_flags']['right_image'] = FALSE;

        if ($parent_entity-&gt;get('field_items')-&gt;count() === 1) {
          $elements[$delta]['#style_flags']['top_image'] = TRUE;
        }
      }
    }
  } catch (\Exception $e) {
    // Add logging
  }


Later on, down in preprocess_node:

// ONLY for the homepage handling of featured content.
      if ($referringEntityType == 'homepage_feature') {
        $variables['top_image'] = $variables['elements']['#style_flags']['top_image'];
        $variables['right_image'] = $variables['elements']['#style_flags']['right_image'];
      }


I was able to then add the same node in the same paragraph type multiple times with the correct information. The correct classes are now applied.

Edit: 

Just to add to this too, be sure to set your cacheable dependencies so any change to what holds references will not require a cache clear:

$parent = $items-&gt;getParent();
$entity-&gt;addCacheableDependency($parent);


Edit 2:

Thanks to extra guidance from 4k4, I injected the renderer service and reduced down to:

    $parent = $items-&gt;getParent();
    $parent_entity = $parent-&gt;getValue();
    $elements[$delta]['#cache']['keys'][] = $parent_entity-&gt;id();
    $elements[$delta]['#cache']['keys'][] = $parent_entity-&gt;bundle();
    $elements[$delta]['#cache']['keys'][] = $parent_entity-&gt;getEntityTypeId();
    $elements[$delta]['#cache']['keys'][] = 'context_aware';

    if ($this-&gt;paragraphDisplaySettings-&gt;isApplicable($parent_entity)) {
      $elements[$delta]['#style_flags'] = $this-&gt;paragraphDisplaySettings-&gt;getSettings($parent_entity);
    }

    $this-&gt;renderer-&gt;addCacheableDependency($elements[$delta], $parent);


paragraphDisplaySettings is a custom service object that aids in evaluating different flags to pass through from the original code just to keep it cleaner and leaner. It's working great.