Several Gundam titles were having that kind of ending, from the extreme ones to the "morally grey"-type. For example:
-) Gundam: Iron-Blooded Orphans can be called the "extreme", where the "villains" of the show won by totally decimating the protags and their group to smithereens.
-) Gundam 0080 also has similar outcome, but some people would argue that the protag was the villain, since their group was the one who wreck things up.
-) Gundam 0083's ends with a complete loss from the protag side, since they failed on their mission, and even the main protag himself can't defeat his rival with his own hands.