A small favor becomes everyone else's problem
Make a running joke develop: each attempt to get rid of a nuisance should inconvenience a different person in a different way.
Let an earned reward cause trouble through a property readers already know it has.
Full ending of the embedded tale in The Story-Teller; a child's death.
On a train, a bachelor tells children a story about Bertha, whose goodness earns medals and permission to visit a park. This is a story told inside the main story.
The medals are introduced as metal objects that click together. Later Bertha hides from a wolf, but her trembling makes them clink and reveals her position. The children prefer this tale to the aunt's earlier moral tale.
Do not reduce the design to 'goodness must be punished.' A new magical defect added only at the ending would break the setup.
The Story-Teller: introduction of the medals and their sound. ↗
The Open Window and The Story-Teller only
The Story-Teller: the medals disclose Bertha's hiding place. ↗
The Open Window and The Story-Teller only
A reward has ordinary properties as well as symbolic meaning. Establish its sound, weight or visibility while the owner is pleased to receive it. A later situation can make that same property troublesome. The reversal should follow what readers already know, without needing a new curse or a rule that good behavior must be punished.
Choose a reward in your story and show one ordinary property when it is received: its sound, size, visibility or maintenance. Later, put the owner in a situation where that property matters. Give them a choice about keeping, concealing or surrendering the reward before the consequence arrives.
Use in my storyMake a running joke develop: each attempt to get rid of a nuisance should inconvenience a different person in a different way.
Make another attempt more frightening by having the danger damage the very ability the character needs to escape it.
Keep several failed attempts interesting by making each fail because of a different person's motives or assumptions.