Strange behaviour on Duplicate/repeat data and the merge

I’m not understanding the behavior of the merge component. When I use list created with repeat or duplicate data components and pass it through the merge, the order of the outputs is different from the order in the D1, D2 inputs and the result is grafted.

The workaround is to flatten the repeat/duplicate data output, but they are supposed to be grafted. Am I misunderstanding some of the logic here?

maybe this helps clarifying:

there is some sorting going on due to the data structure

So, the merge will order the values based on the data path first. Only values with the same data path will be merged in each path?

what I mean is that before the merge happens, you can already see the order you will get after flattening with merging. So in case you have a data tree with {0} and a data tree {0:0} they will not be merged into one tree since their data structures don’t match. The example above with the Suirify component changes the {0:0} data structure to {0} and then merge will keep the order since the data trees match.

One other way to look at it: if you graft the single item you get:

In other words, first the ‘shortest/simplest’ tree gets on top in the merge component, then the order of connections is taken into account