The docs for nodesBetween say:
The callback is invoked with the node, its parent-relative position, its parent node, and its child index
I think the pos (second) arg is actually relative to the node the method was invoked on, not the parent? Is that right? Happy to submit a doc pr if so.