1980s GI Joe kept going up to the mid-1990s, outlasting Transformers G1 and G2. Beast Wars saving Transformers is largely down to the cartoon, while Hasbro had two attempts to revive GI Joe in the 1990s, with Sgt Savage, and GI Joe Extreme, they gave up on both of them very quickly. Unless anyone at Hasbro ever talked about it, it's hard to know if this was due to sales being that bad, or if there were other reasons.
1980s nostalgia in the 2000s got Hasbro making GI Joe toys again, and as with Transformers, they were doing a new iteration of the brand every few years. Most of these things weren't flopping, they just weren't as popular as Transformers, and Sigma 6 was the only time they got a cartoon series instead of one-off specials like Spy Troops or Resolute. Even the two movies didn't flop, they both made a profit, Retaliation made a good profit. They weren't making Transformers money, but nobody was expecting them to.
Transformers Prime was broadcast on The CW as well as The Hub, and shown internationally, while Renegades was only on The Hub, and internationally was only shown in a small number of countries. Prime was more successful because more people saw it, more people had the opportunity to see it.
Transformers and GI Joe were both huge in the 1980s, but since then, Hasbro has considered Transformers a bigger priority. They've gone from treating GI Joe as a secondary concern that's profitable if handled well, to becoming just one of the properties they do nothing with, because they have Transformers, and they have the Marvel and Star Wars licenses. They don't need to take risks on other brands when they've cornered most of the action figure market between those three brands.
If Hasbro ever loses the Marvel license, and if Star Wars toy sales continue to decline, they might take a chance on GI Joe, but it's possible that there's something to the speculation that the people running Hasbro are uncomfortable with producing military toys.