Yeah, for ranged it'd work if the enemy also had active ranged attackers; there'd be a free shot against the fumbler from a randomly chosen enemy shooter (except if an enemy shooter was the fumbler's target that shooter would always get the free shot).There's a huge flaw with this though: attack with what? If I critically miss you with a crossbow or scorching ray, how do you hit me back with only the melee weapon in your hand? If you need a ranged attack, how long do you have to get it out to use it (and possibly with disadvantage if my buddy's in your face)? This would once again punish melee over ranged characters.
If the enemy doesn't have active ranged attackers that means either a) you're shooting into melee, in which case hitting allies should be a significant risk and that's what a fumble would always mean, or b) you're shooting fish in a barrel, in which case the DM would have to decide what went wrong.