You say "NATO brought this on themselves" like they weren't joyous at the prospect of a Russian invasion of Ukraine but I think this isn't true. The west has worked closely to recreate the Ukrainian Army from the ground up since 2014 (when it was useless) because they knew this was a possibility. This war-launched idiotically by Putin-has benefitted the west alone. Not Russia, and obviously not Ukraine.
-Ukraine is now irrevocably tied to the west and will be for the foreseeable future. Before this, western intelligence agencies were worried Zelensky was too pro-Russian. Not anymore.
-Eastern Ukrainians who speak Russian in their mother tongue are now anti-Russian for the most part.
-Lots of juicy money for western MICs.
-The bulk of the Russian Army is tied down in Ukraine and so cannot be used elsewhere-massive limiting of Russia's strategic manoeuvrability.
-Russian economy damaged (not as much as they thought it would, but it's still damaged) and large-scale brain drain of well-educated Russians who oppose the war who have now fled to Georgia and will seek to move to the west most likely. Also Russians living in the west who are more likely to be liberal will be much less likely to come home.
-Strong consolidation and reification of Ukrainian national identity, meaning far less likely for Ukraine to see Russia as a 'kin state/brotherly nation' akin to Azerbaijan/Turkey.
-Exposes and emphasises the fragmentation and factionalism within the Russian state and security apparatus, (see: Wagner).
-Kills lots of Russians whose families may eventually turn against the state once this war drags on and nothing good comes from it.
What I mean to say is that NATO isn't suffering at all-at least, the Americans and Brits aren't. They're overjoyed! You can't "bring something on yourself" forlornly if you're openly working for it, then it's just a success! I mean I don't think they necessarily worked only for the invasion but basically just various means to bring Ukraine into the western fold, of which this was just one (probably not the ideal) option of many.
It was not a 'rational' or sensible reaction to NATO encroachment. I mean realistically with nuclear weapons the idea that a land invasion of Russia could happen is ludicrous, but even removing that factor there were countless other mechanisms at Putin's disposal to achieve his strategic aims. This invasion was a terrible choice and it only happened because (A) the Russian leadership is full of yes-men who are unable to criticise Putin, (B) because the Russian leadership has become increasingly isolated from the realities on the ground in the last few years and so VASTLY misunderstood how the war would go. They thought it would be like Georgia (though the Georgia War was a mess from a Russian perspective they won anyway because of the vastly unbalanced correlation of forces).
Yes, this is a sensible and thoughtless war, but I think expecting Ukrainians to just give up against an aggressor is fruitless. They will not do it as long as they believe they can win (see Zartman's concept of a mutually hurting stalemate), which both sides currently believe they can. Plus if it's a frozen conflict and more or less even, why would Ukraine 'surrender'? Yes, I think the eventual only possible end to this war will be a surrender of some territory (more likely is simply a frozen conflict), but I don't believe it is politically viable atm and so it is pointless to support it. If Zelensky agreed to surrender territory he'd risk being overthrown and probably killed by the far-right and ultra-nationalist sections of the army/state. The morally best situation would be a return to the status quo ante bellum and a referendum in the east and in Crimea monitored by international IGO/NGO bodies not tied to any particular state, but that wont happen.
The balance of forces is even enough that one side admitting defeat is implausible until the mutual damage from the war is much higher and both sides come to realise it is unwinnable (this is a subjective understanding even if there are objective measures of 'mutually hurting stalemate'.
edit: formatting