First of all, that’s a fundamentally flawed and deliberately petty and condescending interpretation of the Sino-Vietnam war as promoted by the west and Vietnam.
The goals of the Chinese intervention (invasion is the wrong term since China never had any territorial designs on northern Vietnam) were primarily to curbstomp Vietnamese delusions of grandeur and attempts to annex all of South East Asia after their high from driving out the Americans.
Failure to do so early could very easily have resulted in the vastly expanded Vietnam turning their greedy eyes northwards towards China after they had consolidated their hold on SE Asia, especially with Soviet backing and maybe even egging them on.
This was why China deemed it an imperative to deal with Vietnam sooner rather than later, and lso to drive a wedge between the fledging Vietnamese-Soviet partnership by proving the Soviets were not willing to fight and die for their new Vietnamese allies, least that relationship deepened and China gets sandwiched between the Soviets to the north and the new Vietnamese empire to the south, enriched by its new conquests and equipped with the latest in soviet weaponry, at which point China might have faced a two pronged invasion by both looking to re-absorb China into the Soviet lead communist order as a true vassal.
The secondary objective was to relieve Vietnamese military pressure on Chinese allies they were attacking.
With the tertiary objective one of destroying as much as their best and most experienced combat forces and war industries as possible to further de-fang them.
Punitive economic damage was only a peripheral consideration and mainly a by product of the destruction of Vietnamese war industries rather than being the primary aim and goal.
Except it won’t. Nobody expects NATO to fight and die for Ukraine, a non-NATO member. But if Ukraine was admitted to NATO, the organisation would be treaty bound to fight for Ukraine or else face the immediate collapse of the NATO alliance. That is why Ukraine is desperately pushing for NATO membership now, and a pointlessly petty Russian punitive war will only make Ukraine more determined to join to prevent another sub attack.
Two major issues. First, there is no mutual defence pact between NATO and Ukraine to shatter. Attacking Ukraine now would almost certainly lead to the creation of just such a pact.
Secondly, there was zero chance of Vietnam forming an alliance with America as a consequence of the Sino-Vietnam war, but every chance of Ukraine entering just such a pact after. The two are nothing alike.
Just as comparing Ukraine to Taiwan is nonsense, comparing Ukraine to Vietnam also doesn’t make sense.
Any military kinetic action short of total annexation will only strength Ukraine’s desire to join NATO, rather than make them disillusioned with the prospect of getting security assurances from NATO.
Maybe Putin is trying to psych NATO out by showing them in no uncertain terms that NATO expansion to include Ukraine is a red line Russia cannot and will not allow NATO to cross.
But my main issue with that is that it is only a bandaid at best, and does not and cannot address the fundamental core issue of both Ukraine and NATO wanting to join. After the war, Russia will still be in exactly the same position as it is now, with NATO wanting to admit Ukraine despite Russian war threats. So what has Russia achieved?