When rendering paragraphs in a theme, is there a way to look at the last rendered paragraph while rendering the current one?
Yes, you can do something like this in preprocess:

    &lt;?php
    // Get entity reference revision item that points to this paragraph.
    /** @var \Drupal\entity_reference_revisions\Plugin\Field\FieldType\EntityReferenceRevisionsItem $item_reference */
    $item_reference = $paragraph-&gt;_referringItem;

    // Get entity reference revision field items list that holds all
    // paragraphs.
    /** @var \Drupal\entity_reference_revisions\EntityReferenceRevisionsFieldItemList $items_list */
    $items_list = $item_reference-&gt;getParent();

    // Get next index position of current paragraph in entity ref. revision
    // field items list.
    $next_delta = $item_reference-&gt;getName() + 1;

    // Check if there is a paragraph on the next delta.
    if ($items_list-&gt;offsetExists($next_delta) &amp;&amp; $items_list-&gt;get($next_delta)-&gt;entity) {


That special property is set in \Drupal\Core\Field\Plugin\Field\FieldFormatter\EntityReferenceFormatterBase::getEntitiesToView(). And because paragraphs themself are not render cached on their own and not used in multiple places means that you can actually rely on it. (It would also be set on a node, but due to render caching, you can not rely on it being there, at least not by default).