How do I differentiate between entries after merging an array?
Not sure if I totally got it but you can check the class of an object via

{% if element is instance of ('craft\\elements\\Entry') %}


or via switch statement

{% switch className(element) %}
    {% case 'craft\\elements\\Entry' %}