Miller goes from hero to villain as Titans win thriller