This happened because of a double child entry on Wikidata (Prince Andrew had two child values of Pricess Euginie) , I think there's no reason to fix it in the code because this should not happen and if so, it should be fixed in wikidata. I deleted the extra value
https://dataprick.github.io/wikitree/public/?q=Q9682&level=5&type=descendants&orientation=North&lang=en will show princess Eugenie https://www.wikidata.org/wiki/Q165709 twice. I assume this is due to the existence of a redirect https://www.wikidata.org/w/index.php?title=Q75383208&redirect=no