Preamble: This updated description is a consolidation of various bug reports (the original description of this bug that @Catrope filed), T71207: Parsoid: Interwiki links are halfway converted to external links, and completely broken and T102556: VE should indicate when it wants external links "WikiLink-ified"
The problem with Parsoid's html2wt for links (which is already complex because wikitext and its overloaded link forms and expectations around roundtripping, dirty diffs, expected canonical form output for HtTML) is best illustrated with this html2wt session:
[subbu@earth:~/work/wmf/parsoid] cat /tmp/html <h2>New content (i.e no data-parsoid), rel-attribute is irrelevant, link serializes to appropriate canonical syntax</h2> <a href="https://en.wikipedia.org/wiki/Hospet">Hospet</a> <a rel="mw:WikiLink" href="https://en.wikipedia.org/wiki/Hospet">Hospet</a> <a rel="mw:ExtLink" href="https://en.wikipedia.org/wiki/Hospet">Hospet</a> <a href="https://www.mediawiki.org/wiki/User%20talk:Whatamidoing%20(WMF)">on Mediawiki</a> <a rel="mw:WikiLink/Interwiki" href="https://www.mediawiki.org/wiki/User%20talk:Whatamidoing%20(WMF)">on Mediawiki</a> <a rel="mw:WikiLink" href="https://www.mediawiki.org/wiki/User%20talk:Whatamidoing%20(WMF)">on Mediawiki</a> <a rel="mw:ExtLink" href="https://www.mediawiki.org/wiki/User%20talk:Whatamidoing%20(WMF)">on Mediawiki</a> <h2>Orig unedited content, rel & data-parsoid produced by wt2html, link serialized to original (not always canonical) syntax</h2> <a rel="mw:WikiLink/Interwiki" href="https://www.mediawiki.org/wiki/User%20talk:Whatamidoing%20(WMF)" data-parsoid='{"stx":"piped","a":{"href":"https://www.mediawiki.org/wiki/User%20talk:Whatamidoing%20(WMF)"},"sa":{"href":"mw:User talk:Whatamidoing (WMF)"},"isIW":true}'>on Mediawiki</a> <a rel="mw:WikiLink" href="./Hospet" data-parsoid='{"stx":"simple","a":{"href":"./Hospet"},"sa":{"href":"Hospet"}}'>Hospet</a> <a rel="mw:ExtLink" href="https://en.wikipedia.org/wiki/Hospet" data-parsoid='{}'>Hospet</a> <h2>Orig unedited content, data-parsoid edited (not possible with production clients), rel-type absent, link serialized to canonical syntax (accidentally)</h2> <a rel="mw:WikiLink" href="./Hospet" data-parsoid='{"stx":"simple"}'>Hospet</a> <h2>Orig unedited content, data-parsoid edited (not possible with production clients), rel-type absent, link serialized to non-canonical extlink but valid syntax</h2> <a href="https://en.wikipedia.org/wiki/Hospet" data-parsoid='{}'>Hospet</a> <a href="https://en.wikipedia.org/wiki/Hospet" data-parsoid='{"stx":"simple"}'>Hospet</a> <a href="https://www.mediawiki.org/wiki/User%20talk:Whatamidoing%20(WMF)" data-parsoid='{}'>on Mediawiki</a> <h2>Orig unedited content, data-parsoid edited (not possible with production clients), rel-value irrelevant, link serialized to non-canonical extlink but valid syntax</h2> <a rel="mw:ExtLink" href="https://en.wikipedia.org/wiki/Hospet" data-parsoid='{"stx":"simple"}'>Hospet</a> <a rel="mw:WikiLink" href="https://en.wikipedia.org/wiki/Hospet" data-parsoid='{}'>Hospet</a> <a rel="mw:WikiLink" href="https://en.wikipedia.org/wiki/Hospet" data-parsoid='{"stx":"simple"}'>Hospet</a> <a rel="mw:WikiLink/Interwiki" href="https://www.mediawiki.org/wiki/User%20talk:Whatamidoing%20(WMF)" data-parsoid='{"stx":"piped"}'>on Mediawiki</a> <a rel="mw:ExtLink" href="https://www.mediawiki.org/wiki/User%20talk:Whatamidoing%20(WMF)" data-parsoid='{"stx":"piped"}'>on Mediawiki</a> <a rel="mw:WikiLink" href="https://www.mediawiki.org/wiki/User%20talk:Whatamidoing%20(WMF)" data-parsoid='{"stx":"piped"}'>on Mediawiki</a> <a rel="mw:WikiLink/Interwiki" href="https://www.mediawiki.org/wiki/User%20talk:Whatamidoing%20(WMF)" data-parsoid='{}'>on Mediawiki</a> <h2>Orig unedited content, data-parsoid edited (not possible with production clients), rel-attribute is irrelevant, link serialized to invalid syntax (because of relative links or bad "a"/"sa" data-parsoid values)</h2> <a href="./Hospet" data-parsoid='{"stx":"simple"}'>Hospet</a> <a rel="mw:ExtLink" href="./Hospet" data-parsoid='{"stx":"simple"}'>Hospet</a> <a href="./Hospet" data-parsoid='{"stx":"simple","a":{"href":"./Hospet"},"sa":{"href":"Hospet"}}'>Hospet</a> <a rel="mw:ExtLink" href="./Hospet" data-parsoid='{"stx":"simple","a":{"href":"./Hospet"},"sa":{"href":"Hospet"}}'>Hospet</a> <a rel="mw:WikiLink/Interwiki" href="https://www.mediawiki.org/wiki/User%20talk:Whatamidoing%20(WMF)" data-parsoid='{"stx":"piped","a":{"href":"https://www.mediawiki.org/wiki/User%20talk:Whatamidoing%20(WMF)"},"sa":{"href":"mw:User talk:Whatamidoing (WMF)"}}'>on Mediawiki</a>
Here is the generated output
subbu@earth:~/work/wmf/parsoid] php bin/parse.php --html2wt < /tmp/html == New content (i.e no data-parsoid), rel-attribute is irrelevant, link serializes to appropriate canonical syntax == [[Hospet]] [[Hospet]] [[Hospet]] [[mw:User talk:Whatamidoing (WMF)|on Mediawiki]] [[mw:User talk:Whatamidoing (WMF)|on Mediawiki]] [[mw:User talk:Whatamidoing (WMF)|on Mediawiki]] [[mw:User talk:Whatamidoing (WMF)|on Mediawiki]] == Orig unedited content, rel & data-parsoid produced by wt2html, link serialized to original (not always canonical) syntax == [[mw:User talk:Whatamidoing (WMF)|on Mediawiki]] [[Hospet]] [https://en.wikipedia.org/wiki/Hospet Hospet] == Orig unedited content, data-parsoid edited (not possible with production clients), rel-type absent, link serialized to canonical syntax (accidentally) == [[Hospet]] == Orig unedited content, data-parsoid edited (not possible with production clients), rel-type absent, link serialized to non-canonical extlink but valid syntax == [https://en.wikipedia.org/wiki/Hospet Hospet] [https://en.wikipedia.org/wiki/Hospet Hospet] [https://www.mediawiki.org/wiki/User%20talk:Whatamidoing%20(WMF) on Mediawiki] == Orig unedited content, data-parsoid edited (not possible with production clients), rel-value irrelevant, link serialized to non-canonical extlink but valid syntax == [https://en.wikipedia.org/wiki/Hospet Hospet] [https://en.wikipedia.org/wiki/Hospet Hospet] [https://en.wikipedia.org/wiki/Hospet Hospet] [https://www.mediawiki.org/wiki/User%20talk:Whatamidoing%20(WMF) on Mediawiki] [https://www.mediawiki.org/wiki/User%20talk:Whatamidoing%20(WMF) on Mediawiki] [https://www.mediawiki.org/wiki/User%20talk:Whatamidoing%20(WMF) on Mediawiki] [https://www.mediawiki.org/wiki/User%20talk:Whatamidoing%20(WMF) on Mediawiki] == Orig unedited content, data-parsoid edited (not possible with production clients), rel-attribute is irrelevant, link serialized to invalid syntax (because of relative links or bad "a"/"sa" data-parsoid values) == [./Hospet Hospet] [./Hospet Hospet] [Hospet Hospet] [Hospet Hospet]
The good thing is that except for edge case scenarios, the broken behavior illustrated in the last segment should not be possible with current versions of Parsoid and editing clients since data-parsoid is never exposed to clients directly. However, Flow with its old stored HTML is an exception to this rule and it probably has content from way back when.
As for as Flow is concerned, one solution that Flow could adopt would be to strip data-parsoid and rel info entirely from links and Parsoid does the right thing just by analyzing the href.
We can fix this in Parsoid itself (and one early attempt via https://gerrit.wikimedia.org/r/c/mediawiki/services/parsoid/+/292078 had to be reverted because it over-aggressively used interwiki forms. A solution for that is captured in T102556#3841768 and the next Parsoid attempt at this should use that interwiki forwarding property. But, this does mean that Parsoid will no longer preserve extlink forms of wikilinks seen in wikitext (except via selser). We resolved in T102556 that is an acceptable compromise.
While at it, Parsoid should also stop generating the "a"/"sa" data-parsoid properties for links altogether since that is not needed anymore, and at worse, when data-parsoid is corrupted / manipulated in bad ways, Parsoid uses that info without validating that information.