Some kinds of invalid wikitext result in unexpected behavior within VisualEditor. The example reported was a case of <ref name"Foo">, which Cite.php interprets as <ref> and which VisualEditor displays as text (both opening and closing ref tags).
When something is known to be wrong, maybe VisualEditor should add note or flag around the known-broken wikitext, to indicate to the user that VisualEditor and/or Parsoid has identified an error in the wikitext.