As you mentioned, the most likely case is bringing the protagonist into a corner through contrived means all for the sake of a plot twist, regardless of how much (or little) sense it makes due to the mangaka not wanting the result of a battle to be too predictable. Of course, trying to subvert expectations in such a way without the talent to pull it off is what leads to many of them being poorly done, something that's becoming more evident with how many modern series (both in and especially outside the anime/manga medium) are abusing the concept.
I'll say that DB's fusions did it okay in the series' original run, with Gotenks being limited by SS3 making sense with how draining the form was and Gotenks' arrogance being in-character and Vegetto needing to stall Boo, though the way in which GT and Super utilise the unexpected limits can be damaging with how uncharacteristically arrogant Gogeta was compared to his Fusion Reborn self or Gotenks messing about before arriving to fight Freeza despite knowing his own limits. The other examples you mentioned are pretty solid cases of asspull wins though, with Kurama having to have enough plot armoured durability to endure Karasu's attacks in his base form and the entire fight with Pain just being one huge mess in general. Gear 4th Luffy is also worth noting in a similar vein with how unnecessary its drawbacks ended up being with its cooldown time just serving to extend the battle with Doflamingo and being pretty much abandoned thereafter, because God forbid Oda actually have one of Luffy's forms have its drawback be relevant beyond its debut battle
.
The best way to execute these types of power up expirations is through it being enough to deplete the enemy enough the protagonist taking them down through their base abilities would be feasible. Jotaro causing enough damage to DIO from his limited timestops to beat him without them kind of counts as this. Unfortunately, few series tend to utilise such a thing or hax an antagonist's abilities to the point it's impossible, or do something to screw up the process. For example, the climax of the ToP could've been executed fine with Jiren being drained if not for his manga self getting enough of a resolve boost he went straight back up to PSSB tier and Galu's anime self suddenly going from almost completely drained to mustering enough Ki to go SSJ. Luffy VS Lucci is also another situation where it could've worked with Gear 3rd doing a lot of damage to Lucci, yet that too was ruined by Luffy asspulling his way to gaining the resolve to overcome Lucci after taking such a severe attack as the Rokuogan.