I have become a big fan of the approach that the GM places NPCs and creatures into the game environment and it us up entirely to the players if and how they want to engage with them. Without a scripted story for the campaign, even encounters the party stumble into by accident can be run away from, and there is no requirement coming from the GM that the players engage with any specific encounters.
In this context, you can't really make an encounter too hard. Too hard for what? Victory in a fight is not a requirement for the game to continue. Nor is getting an NPC to cooperate with whatever the players might hope to gain from the encounter. The only case I can think of where the GM can make an actual mistake is by setting up creatures that look significantly weaker in a fight than they actually are, based on what the players encountered before. But that's easy to avoid. Don't have a cave that is entirely populated by 1 HD goblins, except for one group of eight 6 HD goblins that don't look significantly different.
If the players engage in a fight and it turns out that they are loosing because they have bitten off more than they can chew, you could of course make on the fly adjustments to make the opponents fall much earlier than it would actually have taken the players. But once you start with that, when do you stop? When you start making it your choice that the players should not lose a fight because it wouldn't be satisfying in that moment, then under what conditions will you decide that it is satisfying for them to be defeated?
If the campaign does not hand the players automatic success without a chance to fail, you can't really start pulling them out of the fire. Because when you start, you can never stop. And then the whole exercise of playing the game becomes pointless.