"The Gingerbread Smurfs" is a Season 4 episode from the Smurfs cartoon show.
As the story starts, Brainy is getting on Greedy's nerves by bossing him around about how he bakes. This makes Greedy throw batter and desserts at him, telling the bespectacled Smurf that he thinks he knows everything, but he is really just an amateur baker. Brainy disagrees, claiming that he has an incomparable flair for it, but he just doesn't make a big deal out of it like Greedy does. Greedy scoffs at Brainy's claim and challenges him to a bake-off contest. They wonder what they shall bake when Clumsy suggests gingerbread cookies. They accept and shake hands with each other, as Brainy says, "and may the best Smurf -- meaning me -- win". Papa Smurf is out visiting Homnibus, so Greedy makes him the judge for when he returns the next afternoon.
Soon, Brainy announces to the rest of the Smurfs that there will be a bake-off between himself and Greedy, which will separate the professionals from the amateurs. Jokey scoffs at the idea that Brainy is a professional baker, but Brainy tries to defend himself as being as much a capable cook as Greedy is, if not better. Greedy then pulls out a wagon of cupcakes and all the Smurfs run up to take one, leaving Brainy uselessly banging on a pan with only Clumsy by his side. Later on, Brainy and Clumsy are in his kitchen trying to come up with an original recipe for baking cookies. They use way too many ingredients (including sarsaparilla, as suggested by Clumsy) and then they top it off with "a drop" of volcanic lava juice, which produces a massive explosion that really impresses Jokey and leaves a major mess in Brainy's home.
That evening, Brainy and Clumsy sneak into Papa Smurf's lab and find a recipe in his copy of The Wizard's Cookbook for creating a magic gingerbread cookie. Brainy follows the recipe and sticks the completed confection into the oven to bake while he tries to compose a victory speech. However, Clumsy notices that the oven is shaking and tries to tell Brainy, but he doesn't want to be interrupted, as he wants his speech to go off with a bang. Then, the oven door bursts open with a bang and, to their surprise, his gingerbread cookie comes to life. At first, Brainy is thrilled, but soon realizes the trouble he's created when the cookies multiply and get on all the Smurfs' nerves with their annoying antics, even out-pranking Jokey. Things get even worse when the gingerbread cookies start kicking the Smurfs out of their houses. Brainy goes to Greedy for help, who grudgingly complies, if only to prove to him that a professional knows what he's doing. Greedy stops more cookies from being made by throwing water into the oven, but the Smurfs still have the previously baked ones to deal with.
Papa Smurf rides back on Feathers and sees the living Gingerbread Smurfs running amok. He scolds Brainy, whom apologizes as usual. Papa warns him that he is considering a new apprentice, but rejects Greedy's offer. He then has Brainy successfully reverse the spell. After doing so, Brainy finds one surviving Gingerbread Smurf, so he tries to get a taste test. However, all Brainy gets for his troubles is a toss out of the village, this time along with his cookie, which breaks into pieces when landed on Brainy's head and leaving him muttering that that's the way the cookie crumbles.