As mentioned in T102398. If VE throws an exception (e.g. due to someone breaking site JS on common.js, or a broken browser plugin, or a failed ajax request), there should be a more user friendly error show, with options to launch the source editor or retry.
(I believe that appending ?action=edit&veswitched=1 to the URL, however, is a workaround to get out of VE in those cases? Could be documented better if I'm correct. Once you're in wikitext again, there should be no way for you to go back there unless you really want to.)
@Jdforrester-WMF: I'm thinking of having a go at implementing this for failed load ajax requests... Do you have any thoughts for how this should work for users with visualeditor-tabs=remember-last on SET wikis? E.g. remember that we switched to WTE, or don't remember that we switched to WTE, or maybe even offer the user a choice like "Switch to WTE (remember for future)" vs. "Switch to WTE (just this once)" (vs. "Cancel" vs. "Retry")? I'm leaning towards not remembering such switches