I seem to recall that this is a known "side effect" of measles where it removes many immunities if you catch it.
[0] https://news.harvard.edu/gazette/story/2019/10/how-measles-w...
Very short version: it infects the tissue that create the cells that contain or immune memory, replacing them with versions that only know about the measles virus. Sounds like it's not permanent, though the article doesn't make it clear whether it's recovery or re-learning.
(The reason why many vaccines require boosters is that without the repeat exposure, our immune system decides it doesn't need to remember about that particular pathogen.)