I think this is really best suited for a linguistics subreddit. Also perhaps it'd be better if you specify where your accent is from as my Scottish/English mish-mash accent pronounces T's correctly in both those words given.
Try /r/linguistics! (And it's not a mispronunciation, nor is it a "d," American English actually uses something called a flap in those settings.)