When running the reproducible code at the bottom, I get the strange results in the tree rendered on the left as illustrated in the image below. What am I doing wrong, in my use of the handlers or perhaps in JS script? “Elements” reads the positions of the tree, “Elements2” does a bit of example transformation, and the Element column