Handling of invalid language codes in LanguageConverter markup in VisualEditor appears to have regressed slightly.
Originally for an invalid language code the message visualeditor-mwlanguagevariantcontextitem-rule-invalid-language-label would be displayed in the left hand column below:
In 2020 @Esanders made a change to getLanguageName to return the language code it was provided if there's no name found. At the moment, then, the only way "invalid-language-label" shows up is if there's an empty language code (which the parser would probably reject). The original intent was to display "<Invalid> xx" in the case above, to make it less confusing if the original wikitext was something like -{English: Foo}- which right now shows up as "English English" with no particular indication that the markup is bogus.
In https://gerrit.wikimedia.org/r/c/mediawiki/extensions/VisualEditor/+/1015033 we changed the message to <em>Invalid</em> which would help visually distinguish this from a valid code; this task is for fixing the check for if the language key exists. Currently we use $.uls.data.getAutonym which returns the code if the name is not found.