There is a incorrect join condition on the first join as follows;
JOIN sys.dm_tran_session_transactions [tst]
ON tat.transaction_id = tat.transaction_id
That should be tat.transaction_id = tst.transaction_id
Hope this helps.
David
@SQLTentmaker“He is no fool who gives what he cannot keep to gain that which he cannot lose” - Jim Elliot