I don't see any other way. If Putin is ousted tomorrow, the regime itself will continue in one form or another. And whatever calculations they made, I don't for a second believe Russia invaded just because Putin thought it was a good idea. It was a desperate move. The reason everyone said it wouldn't happen is because it was desperate. That being said, as it was desperate that implies a certain entrenchment within regime/military circles (prior to the war. no idea what it's like now). Just as if the US went to war, or China, and then get bogged down, think Vietnam, or Afghanistan for the Soviets, it doesn't tend to change a whole lot when a new guy comes along (five US presidents for Vietnam, four general secretaries of the USSR for Afghanistan). I'm not saying this is the same thing, this war, but I am saying that the calculus a state uses when it goes to war almost never revolves around one person. Whoever replaces Putin, theoretically, will inherit the same chessboard. Just a change of paint upon the same thing. Barring a wholesale reformation of the Russian state, which I think could happen but only if you give Putin an off-ramp and let him go the way of Franco. It's been personalized, and I understand why, but I think that misses the broader picture. It's the Russian state as a whole, or its administrative part, which is at war here, not just Putin. The US likely trying to see if that falls apart under pressure, which isn't me divining something from the air but more or less repeatedly stated on live television.
I think there was a realpolitik calculation made in the upper air of the Russian administrative state. I don't see how the war goes ahead otherwise. Whether those calculations still hold, or will hold, seems to be what America is trying to find out.
Two ways it ends, I think. The first is the idea that NATO can make the Russian administrative state collapse via pressure on the frontline and behind the scenes. I'm not sold on that. The other is giving the regime and off-ramp along the lines of Franco (the transitional part, not the literal offramp re war). Putin is 70. I think all he wants is to scuttle off with the idea that he can do so without being hunted. If he cannot do that, then he will do whatever else it takes to stay on. Only in that sense do I think it comes down to Putin and his inner core, because they, too, will be targets in such a scenario.
The longer it goes on though, the less likely it is that the next guy just says "we'll end the war" because it will veer out of control to the point where even though no one wants it to continue, the prospect of defeat will be the same for the new regime as it is for the current, in the eyes of the military establishment and the general population.