The commented <ref> seems to throw off the tokenizer -- it is probably the regexp that extracts the ref content there or the ordering of productions (comments and extension tags).
A<ref>B <!--<ref name="x" />--></ref> C<ref>D</ref>
Reduced test case from output seen in http://parsoid-lb.eqiad.wikimedia.org/enwiki/Axial_Seamount?oldid=657127754
See report here: https://en.wikipedia.org/w/index.php?title=Wikipedia:VisualEditor/Feedback&oldid=657286828#Article_swallowed_as_a_note.