Recently, James Gunn confirmed that he almost removed Ego during filming. In 2014, Marvel didn't own the rights to Ego, but he didn't know that would remain the case when he wrote the script.
In fact, he revealed Ego as an antagonist almost never happened.
More Guardians of the Galaxy: James Gunn Tweets About Galactus Guardians of the Galaxy Fan Theory Circulating Twitter
Guardians of the Galaxy Vol. 3 Galactus
At the time, Fox owned the character Ego for movies, but he was in the Guardians of the Galaxy Vol. 2 script already. To use a character named "Negasonic Teenage Warhead," Fox had to get Marvel's permission to use the powers. Marvel traded the use of powers for Negasonic Teenage Warhead for the Ego character.
"These things are complex," explains James Gunn.
Fox made the deal to allow Disney to use Ego without knowing Disney already did so. Having this information would be key to any deal and would cause Fox to have issues with their property being used. Fox probably would have demanded more in return.
More Entertainment: Matrix Star Leaks Surprise Casting of Major Star In Matrix Resurrections
His tweet stated:
"I was told we owned the character [Ego] which was a mistake. I didn't find out we didn't have the rights to the character until after the deal was made. Thank God because [Ego] was deeply imbedded in the script."
Disney acquired Fox in 2019, so this issue no longer exists. As of now, any character can be used (except Spider-Man).
According to the tweet above, it would have been detrimental to the Guardians of the Galaxy Vol. 2 if the deal did not go through.