Comic relief as concept primarily serves purpose to act as speedbump in decreasing serious, mature or intense tone of story, protagonists and development in literature.

Its not meant to be taken seriously most of the time and role often remains limited and under frame of just being casual entertainment either provided through human character through one of its personality traits or in this situation pokemon themselves.

As such many comic relief pokemon lack more defining purpoise and value outside of giving audience occasional laugh and witty, awkward situations in which it may put its trainer.
Either putting smile on your face or aggravating you when it ruins suspense.

We all know how much we may have liked and disliked moments when Wobbuffet popped out of pokeball,
Ash Oshawortt, Brock Croagunk, Misty Psyduck(im surprised this one was almost forgotten) etc, etc.

However not all pokemon providing comic elief were serving purpose to be there just for simple gimmick.

Thankfully;

Some of good examples were Misty Psyduck. It didnt knew how to battle, it couldnt swim and it could often cause irritation and anger from its trainer resulting in hilarious dynamic.

But Psyduck also served as stepping stone in helping Misty to start better understanding her pokemon and appreciating them for who they are, being road through which its trauner developed more patience over time thus playing role in character development.

This can be noticeable in Misty rather hostile and disappointed nature expressed toward yellow duck, gradually starting to warm up to it, care not wanting to trade her pokemon away such as in that festival where Jessie got Wobbuffet. And being more tolerant of its clueless, confused attitude regardless of sometime getting on her nerves or making her mad losing patience(well no one is perfect).

Psyduck example served its purpose well in helping to develop its trainer, while starting to become more caring and protective over Misty too. Well as helpful as he could be as noticed when trying to save its trainer himself in episode with Coastline leader Dorian for example after seeing Misty pushing him away from Whirlpool created by TR machine ending sucked herself into it. Knowing how despite all yelling and moments of annoyance Misty really cares for him.

Being more than just cheap source of comedy showing more to his personality and reason to exist in story., I miss both that duck and its trainer in anime.

Another good example is Dawn Piplup. It was often seen outside of pokeball garnering lot of attention and being involved in all kind of childish tantrums. Comic situations caused by his pride and temperament nature getting into fight with other group pokemon. Having pretty big appetite, being target for Ash Gible practice with draco meteor, attempting to stop Mamoswine and its preevolved forms or even showing affection toward other pokempon of same gender under influence of chemical reactions such as attract.

Admittedly getting too much spotlight at cost of other pokeon. But there is no denying that Piplup also received character growth as ecvidenced in his relationship with Dawn becoming more caring and attached to her. Being of great help in contests. In deciding to resist evolution wanting to remain in unevolved form and coming to realization how he doesnt need to become bigger to be strong and productive. Along with becoming more acceptable of other pokemon differences in group.

So not all pokemon from main characters which played role of comic relief stayed just at that. Being collection of random gags and exaggerated overused expressions.
Which is good thing afterall.

Because to me comic relief is fine to relieve some of suspense from plot only if its in:
-moderated doses
-pokemon serve some other purpose by either itself developing or influencing development of trainer and story itself.

Having more purpose beside comedy in anime,.