There is no official source to answer this question, so I will do my best to answer it with canon from the movies:
We know of roughly 4 occasions when Ant-Man becomes (Gi)Ant-Man:
- In a lab. We don't see this instance on screen, but Scott says that he passed out.
- In Civil War. We do see this one, but he isn't big for very long before Iron Man and War Machine hit him in the face. After that he goes normal size, and is tired.
- In Ant-Man and the Wasp he becomes (Gi)Ant-Man a couple of times, and eventually passes out.
- And finally, In Avengers: Endgame he becomes (Gi)Ant-Man in the Battle Of Earth, and doesn't appear to suffer any drawbacks.
So we can conclude the In-Universe reason is probably that he got used to it, and the Out-of-Universe answer is that the passing out bit is just so he isn't so hugely OP, and in Endgame they just weren't so concerned about that, because the opposition was much stronger.
Have a read of the comments on the accepted answer on this related question: Is Ant-Man referring to any specific incident?
This, for example:
I vaguely recall something in the Ultimates comics about Giant-Man
(Henry Pym) passing out the first few times he grew before he got the
hang of it, so it MIGHT be a reference to that, but it's a bit
speculative. – starpilotsix Jun 26 '17 at 17:29
I known it isn't official, but it's also worth reading what's on the fandom wiki:
Lang cannot maintain himself giant for extended periods time, as it
causes some heavy stress on his body and if done long enough he can
even faint. However, Lang seemed to be getting used to it the more
times he does it, and instead of fainting he only gets very exhausted;
by the time of Battle of Earth, Lang remained most of the conflict in
giant form without fainting, exhausting, or showing any major