The following contains spoilers for Avengers: Infinity War.
While the Marvel Cinematic Universe has become a massive franchise, James Gunn has been building his own little quiet corner of it. However, that all changed with Avengers: Infinity War. The Russo Brothers recently revealed that they were given such freedom in crafting the story for the new MCU movie that they never actually talked to James Gunn about killing off one of the Guardians of the Galaxy.
The perception of the Marvel Cinematic Universe has always been that it's a massive machine with writers, directors, and actors, merely cogs. However, the Russo Brothers' comments to the Happy Sad Confused Podcast would seem to directly contradict that idea. It seems there was no specific plan for Avengers: Infinity War or Avengers 4 until the Russos created one, and they had the freedom to kill off characters without bothering with how it might impact the rest of the universe.
James Gunn has written and directed both of the Guardians of the Galaxy movies thus far and he's currently working on the script for a third. Clearly, at some point, James Gunn was made aware of the decision, and he certainly would have known what was going on before he made the decision to return to complete his trilogy, but one would have thought that if there were hopes to make a third Guardians movie with Gunn back when the script for Infinity War was being written, Gunn would have been brought into the conversation.
However, it seems Marvel's dedication to freedom extends pretty far. The company doesn't want to hamstring its directors by preventing them from doing what the story requires because of what future stories might be told. Joe Russo says this is part of the reason that he and his brother have made Marvel their home for so long.
I would also include James Gunn's Guardians of the Galaxy Vol. 2 in that list of recent Marvel movies that have taken risks. Not only did it kill off a popular character, but it dealt with some much heavier themes than the previous, more light-hearted entry.
While we have little idea what's in store for us when Avengers 4 comes along, it seems the Russo Brothers could do whatever they wanted, which means anything is possible.