I more or less understand the first example, even if that's already something that could happen under gen I mechanics (I.E. cure Sleep vs. a Hypnosis user and they'll immediately click Hypnosis again, mainly applicable for Psychic weak mons), but the second scenario is something that would happen in any situation where only one move can get a KO, and the AI randomly selects from potential KO moves, so even at best there's a 25% chance it would have picked that move again whether you healed or not. Plus, if I'm not mistaken, the AI actually prioritizes moves with secondary effects anyway, not just the strongest move available.
Regardless of the validity of your examples, something like using Will-o-Wisp on a non-Burned mon is exactly what I'm talking about with learning how the AI works and exploiting that. If the AI prioritizes applying a Burn, then you know that it will attempt to do so when possible and can work with that information, using a Guts user or something else that doesn't care about a Burn, or a Special Attacker. If the AI continually hammers away at something you're trying to heal, sticking yourself in a loop...that's on you for being put in that scenario. Why should you get a free heal with negligible damage just because the AI randomly allowed you to do so? The games are easy enough as they are without the AI randomly allowing you to get away with brute forcing your way through heal spam. Maybe you should try a better strategy instead.
Also, the AI making pointless switches would be much more likely in a scenario where you gave it the capacity to make "predictions". If an AI that had information on the player's next move had the capacity to switch accordingly, it would only do so if it was actually advantageous for it to do so, I.E. throwing out a resistance/immunity or something capable of KOing the player's current mon. Most of the time you likely would not even know the AI had the capacity to read the player's moves with how poorly constructed 95% of the teams are.
Not to mention this AI doesn't even have to be universally applied...even gen I had like three different AI behaviors. Reserving it for opponents with actually balanced teams that could make use of the broad range of types and strategies available to them would be fine. No need for the typical Rock first gym leader to read the player's moves if they're just gonna get swept by Bubble anyway.