Based on Valorum's updated answer on Is the Star Wars Universe just one galaxy?, this seems to have started with a Wookieepedia editor conflating the Revenge of the Sith novelization with Revenge of the Sith: Incredible Cross-Sections. The reprint in the Complete Cross-Sections book has the following:
The Imperial Starfleet will justify its existence in unending war against Separatist holdouts, dissident rebels and even, it is rumored, deterring barbarian invaders from outside the galaxy.
Source: Star Wars: Complete Cross-Sections (2007), page 75 (Star Destroyer—Venator Class); emphasis added
While this is apparently a reference to the Yuuzhan Vong, all this confirms in Legends is that a rumor existed that the Empire could cite the threat of extragalactic invaders as a reason for amassing a larger navy.
Note that this reference was edited out in the Canon reprint of the same cross-section:
The Imperial Navy will justify its existence in unending war against Separatist holdouts and dissident rebels.
Source: Star Wars: Complete Vehicles (2020), page 78 (Venator-Class Star Destroyer)