This is the rule of pronouncing "the" in English.
English Pronunciation: How to Pronounce "the" | EnglishClub.com
And "that" is pronounced "Št" like "dat". So there's no problem with both pronunciation.
I wish these could help you something. :D
Student or Learner