Of course, Vietnam did realize the USSR was a feckless ally, but China couldn't control that.
China is an inward-facing country. They've never been good at projecting their power outward.
[I am not going by Vietnam PR. China pulled out after one month without completing it’s objectives. First of all, Vietnam remained in Cambodia for another decade, after they kicked out China’s client, the Khmer Rouge. Also, they didn’t like that Vietnam was in the USSR’s orbit, not theirs.]
That it failed to achieve its stretch target isn’t particularly significant. MACV took almost 5 weeks to dislodge the NVA from Hue (the battle depicted in Full Metal Jacket) and it had the benefit of 24/7 tac air and the full aerial panoply of supply interdiction assets.
Given the equipment and experience limitations of the Chinese force, it gave a good account of itself. While its inflated self-image was unwarranted, the enlisted men did banzai charges and were butchered without faltering. Having learned that massed charges were a mistake and that they weren’t in fact superior to the Vietnamese in military skill, they buckled down and resized their objectives to fit their new understanding of where they stood relative to their adversary. They wiped out an elite Vietnamese division at Lang Son, then withdrew with everything they could carry, having wiped out anyone who might have given chase.
While the Chinese failed to achieve their initial objective, they did give Vietnam a bloody nose and inflict more damage than they took. Parity in military dead, 100K dead Vietnamese civilians and Vietnam’s loss of Soviet factory equipment suggests that this was at best a draw for Vietnam, and at worst, a defeat.