The ironic thing is, the only time in TOS that there was ever a threat to the entire universe was in the absymal "The Alternative Factor." The closest thing to a threat to the entire galaxy as a whole was the planned Kelvan invasion. And there was never a threat to Earth until TMP.
In fact, dangers to the whole universe are extremely rare in canonical Trek. Time-travel events that threaten to transform
the universe are fairly common, but when it comes to threats that could destroy
the universe, all I can think of is DS9's "Playing God," yet another iteration of the "baby universe threatening to expand into and destroy our own" trope. Threats to the galaxy as a whole are pretty rare in canon as well. It was implied that the Q Civil War in "The Q and the Gray" would've devastated much of the galaxy if it had gone on for much longer, and in ENT season 3, the Sphere-Builders' transformation of space would presumably have gradually engulfed the galaxy or beyond if it hadn't been stopped.
So really, the "save the galaxy/universe" trope is quite rare in canonical Trek. It's much more common in tie-ins.