Ukraine can’t really threaten Russia as a whole, and the further Ukraine gets, the thinner and more vulnerable the supply lines will be. So the whole thing will eventually run out of steam and Russia can try to grind its territory back under its control.
Of course it’s annoying and embarrassing for Putin, but letting it just fizzle out is definitely within his MO.