The problem is they took a lot of traditional Chinese territory held since the Han dynasty while China was disunited and weak. As soon as the Sui reunited China, they started warring to retake those lands, and when the Sui failed and were in turn overthrown by the Tang, the Tang came right back. If you look at the history of the wars, you see that Goguryeo did extremely well, defeating multiple vast armies. However, whoever unites China will have enough resources to keep on trying until they succeed.
No Korean/South Manchurian polity could keep out the Chinese armies forever, and whoever rules China would never give up. So for Goguryeo to survive much less unite all Korea, either China needs to remain disunited, or Goguryeo needs to pull out of Manchuria and accept a vassal status with the Chinese Empire.