I guess it's often that the heroes have plot armour and writers likely fear the kids watching will be traumatised if the heroes get brutalised as badly as the villains do. This is likely why lots of shows just go for bumbling villains, though even then it sometimes seems like they have to skew physics to avoid the heroes getting hurt. (eg. Team Rocket battles in the Pokemon anime have gradually become more about Jessie and James' Pokemon (or Meowth's mechs) firing scare tactic shots around the twerps and generally acting like Stormtroopers, and actually have considerably less times they try to cheap shot the trainers themselves than the heroes. Even the times they do fight well they now tend to bend it in a way so the twerps' cuter Pokemon still don't suffer a single direct blow, it's karma yes, but they're so defanged it's hard to consider beating them an accomplishment).
Concerning the Spongebob example, A Breath Of Fresh Squidward is probably the prime case of Spongebob getting a taste of his own medicine. Squidward gets electric shocked and it affects his personality to become as happy and upbeat (and clingy) as Spongebob, meaning he soon drives Spongebob crazy the same way vice versa usually does, steals his popularity and even breaks his Employee of the Month record (which a previous episode established he was FIERCELY protective of). To add to it, the ending has Squidward back to normal through another electric shock, but it also makes Spongebob a grouch as well.
Also Sonic Boom had at least three episodes the heroes got a comeuppance, Into the Wilderness and Designated Heroes for Sonic and Chez Amy for Amy. I think this might actually be the only interpretation I've seen Sonic get a 'loser' role in fact.
My personal synopsis: I'm not the most energetic or enthusiastic person you'll ever meet, but that doesn't mean I can't have fun. Generally, I'm pretty introverted and usually play video games, watch anime, and also study in the field of IT. I'm a huge music fanatic, as well. And I listen to pretty much everything except country. My favorites being trap, jazz, and metal.