your timeline is wrong. The stinger at the end of Captain Marvel didn't mean she was already working with the Avengers when we saw her. That stinger is literally replayed in Endgame (they do this a lot... the Bucky/Ant-Man stinger at the end of Winter Soldier came directly from a scene in Civil War later... same with the Thor Rag stinger where they saw the Guardians). They do slight of hand with those making it seem like they're happening "in place" but are really just cribbed from the middle of a future movie).
That's not what I meant. I meant from the time of the introduction to each to the time they found Tony. In the end credit scene in Captain Marvel she comes back a short time after the SNAP. From what I read End Game picks up about 3 weeks after those events.
Now your making me question my memory of the movie. LOL. However, I swear it was Kevin Feige or the Russo Brothers that said the End Game is about 3 weeks later from the end credit scene. I am going to have to find it now.
Update: So Tony says on the ship it's been 22 days since the SNAP. Not sure how much time passes with the Avengers playing with the pager but it appears it's soon after the pager was activated by Fury. Captain Marvel shows up.
Correct me if I am wrong but then some time passes when she finds Tony in space. That would seem to align with the concept of her searching in space for Tony. That's why people theorized either she was searching that region of space on her own or maybe Rocket knew about where the ship might be or something to that effect.
Again, I might be remember the sequence of events wrong.