Avengers: Endgame was a huge success but it also had some problematic moments behind the scenes. This was bound to happen since both Endgame and its predecessor, Infinity War, were shot back-to-back, not to mention some of the reshoots that took place to fix any issues, which is common for most Hollywood movies. There were also some writing issues, as co-writer Stephen McFeely discusses how problematic writing for Captain Marvel was.
While Captain Marvel came out first, Avengers: Endgame was already in production and they had to shoot Brie Larson's scenes for the latter already. This was tough since they had to work with that film's writers to get her voice right and couldn't watch the movie for pointers since it wasn't out yet. Plus, Captain Marvel takes place in the ‘90s so there's a big 20-year leap between both movies.
Here's what McFeely told Backstory Magazine (via ComicBook.com):
Avengers: Endgame is now available in digital platforms, while the Blu-ray and DVD come out on August 13. Captain Marvel is now available on digital, Blu-ray, and DVD.
Read:Eternals: Gemma Chan Isn't the First Person to Have 2 Roles in the MCU