.. when called without flag LYD_DIFF_DEFAULTS on node having LYD_DEFAULT or when called on opaque node.
Root cause: nosiblings is checked only when node comparison completed but it not happens on opaque or LYD_DEFAULT nodes.
Workaround: modify application to not call lyd_diff_tree in such cases. But may be it makes sense to check nosiblings and break instead of continue there ?