|mediawiki/extensions/VisualEditor : master||Check user permissions for viewsource before loading VE on-load on action=edit/submit etc.|
When preference for registered users is "always give me VE", clicking on the switch icon won't actually switch (the wikitext editor is shown for a few seconds, but then the page is still in VEdit mode).
For IPs who have VE as the last used editor, clicking on the switch icon will lead them to the the actual "View source for Main Page", which sets WT as the last editor for them with no ability to switch back, since the toolbar isn't loaded in this case (so I guess this could be generalized to "which kind of loading checks happen for protected pages", or something).
You made it happen with 'keep changes'? Or you weren't prompted to choose between keeping and discarding because you made no edits, and therefore the discard process was used regardless?