This is actually a pretty common problem that story-based Tabletop RPG's wrestle with.
See, the most satisfying stories involve the heroes *failing* at key moments, and then coming back to succeed later. Return of the Jedi wouldn't have been remotely as satisfying without Empire Strikes Back.
The heroes failing raises tension, raises the stakes, and makes victory all the more satisfying.
So, if you want a satisfying story (the goal of story-focused Tabletop RPG systems) you need the heroes to fail periodically. Except, tabletop RPGs are a cooperative game, games that the players are expected to win (much like video games). So, as the players get better, failure becomes less and less likely. And you can very easily get into a situation where the players never lose, even if the fiction suggests they should. Imagine if Luke Skywalker defeated Darth Vader in Cloud City!
Alternatively, because they are games with random elements, they might get killed by the first random goblin they fight, which doesn't make for a satisfying story either.
So, if you're interested in some inspiration, you can always look at tabletop story-based games, to see what other people have done to thread this.
The approach that FATE (
https://fate-srd.com/) takes for example, is to try to divorce the player's goal from their character's.
The player's goal is no longer to make their character to succeed. That's not the "game." The "game" is to tell a satisfying story. Thus, the game introduces meta currency that players accumulate when they lean into their character's flaws, and when they allow and/or make them fail. This meta currency can then be used to ensure success later. In fact, even if a character fails, a player could decide they succeed instead but at a cost!
So one could attempt something like that. Acknowledge that the player's goal (see the main character get spanked) is different from their character's goal (succeed and *not* get spanked). Maybe have a mechanic where characters have to pay some sort of "cost" when they succeed (like a spanking! Maybe they had to break a few laws to get the bad guy), or maybe they get some sort of bonus for failing (let the character fail now, get spanked, but get a bonus to use later). I attempt to apply the FATE approach to a game in Samantha Stone:
https://www.spankingrpgs.com/wp-cont...tha_stone.html
It's barely started, but might give you an idea of how it works. To no one's surprise, this sort of thing is difficult. Just to keep things manageable, you'd probably be best off giving the players a predefined character with a specific set of traits, rather than try to offer a list to choose from like I do here.
Another approach is what Powered by The Apocalypse style games do: your characters only improve (i.e. gain XP) when they fail. When they succeed, good things happen in the fiction. When they fail, bad things happen but they get better. So you could take this approach, and have the challenges they face get progressively more challenging. So either players will eventually start failing despite their best efforts, or will be incentivized to pick obviously less likely to succeed choices so they can improve and be able to overcome later obstacles.
Neither of these are especially satisfying answers, I'll admit. The first one is very difficult to implement in a satisfactory way in a video game, and the second could feel rather forced. Plus, both divorce the concerns of the player from the concerns of the character, which players may find inhibits their immersion.
One idea that really stands out to me, is to really lean into the idea of "success at a cost." Engineer your mechanics somehow so that when the players use them, they pay a price (likely spankings). If it's a CHYOA, then set it up so that most choices that succeed still have some sort of negative side-effect that gets the PC in trouble (you stopped the villain, but the bank is in ruins! You saved the hostages, but the villain got away!). If it's a side-scroller or something, have some sort of energy bar that the player drains as they use abilities, and if they reach the end of the stage with the bar too low, some figure-in-the-shadows whose been watching them shows up and spanks them while they're weak.
They still beat the level and can advance, but they got spanked all the same.