I don't know besides not playing the game.
Random unavoidable enemy encounters is the worst feature in gaming. People generally don't like respawning enemies, and this is an amped up version of that. You have no sense of progressing a level, you can't backtrack or explore safely, you don't have agency to decide what encounters to to take or prepare for, it's all just constant unavoidable drain of your time and resources.
It's only done when the dev doesn't want to spend any time on mindful map design or balance the progression system.