May be a long shot but on P22 Navaras I've seen a few with issues as described only in 3rd and 4th gear. Due to a faulty switch on the gearbox, right at the base of the gearlever in the housing rhs. Disconnecting this solves the problem on these, think its a neutral switch, this is not fitted on 2.7td Terranos but I dont know about yours? Worth a try!