This order does make a lot of sense in some ways, as Carol Danvers’ arrival as Captain Marvel is an important moment, and is paired perfectly with her arrival with the Avengers in the following film.
Captain Marvel is set in the 1990s after all, so it may be confusing to meet her before many of the other films, then not see her for a long while before she comes into Avengers: Endgame.
However, there is also the chronological order with regards the timeline itself, which is a little harder to place.
For example, Spider-Man: Homecoming is a tricky one to place, given it takes place among a group of introductory movies such as Doctor Strange and Black Panther.
We do know, at least, it comes after Captain America: Civil War, as the movie begins with his behind-the-scenes footage of his Avengers adventures.