Hi Andrew,
Datasets have additional metadata and SameQ tests if the expressions are identical. Take a look at the results of
SameQ
FullForm /@ {l1, l2, l3}
and
FullForm /@ {d1, d2, d3}
You have to compare the Normal
Normal
SameQ @@ Normal /@ {d1, d2, d3}
Thank you! Applying Normal before doing a test fixed the bug in my program.