You know Mario and Rabbids Sparks of Hope?
(Bear in mind, I have never played this game.) When Rosalina turns bad, she takes control of Bowser’s minions and all of mushroom kingdom. So it’s at this point, Bowser finally realizes: “If I can’t beat Mario, join Mario!” Is that correct? He realizes now it’s best to just fight for Peach and Mario instead of force Peach to marry him like in Super Mario Odyssey.
Even in the main series he’s been switching between power hungry destroyer of worlds (Galaxy, Wonder) and goofy bully with a Peach obsession (Sunshine, Odyssey) for a long time.
Yeah, RPGs (Square, Paper or M&L) often have him team up with the good guys when he’s been out-villained. He’s particularly depicted as incompetent in those, and usually kicked out of his own castle, it and his minions being one of the rare other things he cares about.