I mean that one is actually explained in the movie, he didn't have the Time Stone on him during the whole fight, hiding it away from Thanos. His amulet was a fake/empty one.
But it was in his arsenal on earth and in space, it was a possible way to defeat him with no obvious reason why it should fail. The writers declared by fiat that letting him win was "the only way" or whatever. That's how this business rolls. "but can't x power beat him" is only going to be true if the writer wants that to be the case, ant man certainly isn't going to one shot thanos with a shrink ray even if, again, I don't think theres any specific reason why it shouldn't work in theory.