Depends on the system and specifics.
Off-hand, I don't remember missed attacks being explicitly punished in D&D 5E with any frequency, although there are certainly cases where actually hitting can be punished (melee attacks versus rust monsters, black puddings, fire elementals etc potentially having negative consequences on a hit, but not on a miss).
For something like Pathfinder 2E, even vs. basic Strikes some creatures might have a reaction that punishes a miss or critical miss. Critically failing a Strike against a swashbuckler or similar foe gives them the opportunity to make a Strike against you or attempt to disarm you, for instance. Likewise, critically failing certain combat actions, like grappling or tripping, will actually backfire and leave you in a worse situation than if you'd burned the action doing nothing at all. Actions with the "Attack" trait also increase multi-attack penalty; e.g. attempting and failing to Strike when you're grappled will increase the difficulty of attempting to Escape with a subsequent action on that same turn, because Escape has the "Attack" trait as well.
For certain systems (e.g. Call of Cthulhu 7E), attempting a melee attack gives the defender the choice of parrying, dodging... or counterattacking. If the defender chooses to counterattack in CoC 7E, he needs a better degree of success than the attacker to win the contest; but if he does, he'll hit and the original attacker will not be able to defend against it. In addition, the counterattack does not consume the defender's action for that round, so the defender would still be able to attack on his own turn for additional damage. In its cousin Runequest, counterattacking isn't an option; but a successful parry can damage the attacker's weapon, again potentially leaving him in a significantly worse situation.