As said already your 3-bet is to small, and if you use a more normal size like even 3X, then TPTK is a very easy automatic stack off postflop in a 3-bet pot. As played there is almost a pot sized bet left on the river, but I am not sure, that even changes things that much. The opponents line is definitely weird. He is representing an oddly played flopped set, sticky TT, that rivered it, and maybe a hand like T8s or KT, that somehow made it past the flop.
Some people will spazz donk shove the river, when they miss their draw or feel, their marginal made hand is not good enough to call again. So I dont really see myself folding TPTK to this line of this runout, unless there was some kind of live read, that this guy would only get it in with the nuts.
For me this all boils back down to preflop. By 3-betting to a more normal size you reduce the chance of getting called by hands like 22, 55 or T8s and therefore also the chance of getting coolered on a board like this. And in general its better to win a small pot without showdown than losing your entire stack on the river.
__________________
|