Sure, you can pull back for strategic reasons but they need to be offset against the propoganda value of how it looks to be losing territory. Being overextended would generally only happen right after a long offensive, not when you've been sitting in the same territory for months. Or you might try to shorten your line if you're running low on troops, but Russia is not typically known for running low on troops.

From what I heard, Zelensky has been pushing for an offensive for some time because he's afraid if the war remains a stalemate the high energy prices would cause the West to weaken. So it seems like they were planning this attack, they did it, and the Russians pretty much just melted away. I certainly don't think that means Zelensky will be marching into Moscow anytime soon, but if Russia keeps losing, the hope is that at some point their own people or oligarchy or military or all of the above will decide Putin has to go.