I think a lot of people think it's a bad idea tout a villain for seven years across a lot of movies as a guy who will take the combined might of all the heroes to beat, just to introduce a character right beforehand who can solo said villain. Carol's movie is literally the movie right before Endgame. At least it doesn't make sense to me.
And as far as the writing goes, they had to take a detour through Retcon City and also introduce some contrivances why she wasn't around during other major times of need (which is already a weakness of the MCU), and it's not like the movie would've been worse if they held off Carol's debut until after Endgame. Infinity War and Endgame have a lot of value from featuring characters with whom the audience have a history, all appearing in at least two feature films, and most of whom have a grudge to settle with Thanos or just the threat of Thanos. Carol doesn't check those boxes, and because of her lack of history, her insertion in Endgame just makes her presence in the movie feel awkward.
If you really want Carol to be the most alpha alpha of them all, introduce her after Thanos.