You’ve gotten the solution, so that’s great. Now, since this is something that happens to me at minimum a couple of times a week, I might be able to provide some insight into the cause.
I work in a European financial hub, touching documents that have been sent to us from all over the continent and beyond. These are commonly edited by people from multiple countries. As a result, the documents are (for lack of a better word) polluted with little bits of localisation cruft, where Microsoft Word is attempting to respect each user’s language and keyboard settings as they perform their revisions. As I page through a given document, I can observe Word’s language label at bottom left regularly changing: English (US), English (UK), French (France), French (Belgium), German (Germany), German (Austria), etc etc etc, reflecting where different people have made amendments in isolated paragraphs here and there, and Word has “helpfully” embedded markers reflecting each user’s preferences for the relevant text.
The most obvious effect of these markers is in spell check. If you have a pararaph in UK English, but it gets reclassified as (say) Swedish, nearly everything will be underlined in red. However, in my experience, these embedded markers also affect the current keyboard setting. Word, quite reasonably, says to itself, this part of the document is in Swiss French, so obviously the editor is working with a Swiss keyboard; let’s switch! And then, when I strike the Y key, I get a Z instead, and vice versa. It doesn’t even require the whole paragraph to be labeled with the alternative language; these little markers seem to be hidden and effectively arbitrary, and it’s just my bad luck the cursor happens to move through one, triggering the change.
A quick touch on Windows + space, and I’m back to my own preference, but it is an irritating little hiccup in my workflow.
If my multi-national work environment is similar to yours, if anything above sounds familiar to you, then this could be why you’re seeing the random switchover.