I've been learning for a few days, so sorry if I'm wrong :P
This: Ten - masculine (nominative and accusative inanimate) Ta - feminine (nominative) To - neuter (nominative and accusative) Tego - masculine (accusative animate) Tę - feminine (accusative)
That: Tamten - masculine (nominative and accusative inanimate) Tamta - feminine (nominative) Tamto - neuter (nominative and accusative) Tamtego - masculine (accusative animate) Tamtą - feminine (accusative)
I understand perfectly why is "tę" and not "tą" (because it is in the Accusative case). No problem with that. The problem is tamta/tamtą. If all was logic, it should be tamta/tamtę. Maybe this problem is what makes native polish say "tą" and not "tę" in the accusative feminine.
The sentence is in the accusative case because there is a direct object (this tea). For accusative femine objects, you use tę. Even polish native speakers get this wrong. See an excellent guide here: https://www.clozemaster.com/blog/polish-demonstrative-pronouns/