It goes deeper than this. Yi was the one that crushed the Red Turban's attempt to raid Goryeo, and had a very antagonist relationship with Zhu. Furthermore, you're confusing "Confucianism as a political ideology" and "Confucianism as a religious ideology". It was only after the fall of Ming that the full-blown religious emphasis with 小中華 came into being, with everything before never reaching religious-philosophical tones except for political reasons. It was always "externally a king, internally an emperor" for Joseon. This goes directly against your assumption that the relationship with Ming had any importance above security and trade. This continues to.....
Please explain the difference, then. Confucianism as a religious institution was always political.
If (and again it's a big if) the calculated benefits of allying with Japan was to be bigger than having a very weak Ming (Ming was facing multiple conflicts, and we can throw in a few butterflies to have the Manchurian tribes be even more of a threat), then I don't see it as impossible for Joseon to backstab Ming.
Except at their very weakest point, Joseon still didn't betray the Ming until there was literally a gun to their heads. There was clearly far far more to the relationship with China than just "don't anger the dragon." There was honest admiration, access to huge markets, and yes, this "external king, internal emperor" mindset with which the Yi Dynasty drew their legitimacy. And yet, Joseon never betrayed Ming even when it was literally suicide for them to do so when the Manchu invaded and even to the 1680s when there were still Ming pretenders, but 0 possibility of them ever regaining the throne.