@selva_tvi ahhhh I'll need to think on this. On closer inspection of the Gcode file, your machine follows this logic
T0 prints at Z=0.2
T1 is called, tfree0.g is run
Per tfree0.g, you move Z: G1 Z3 F500 ; up 3mm
T1 nozzle moves to the next printing location: G1 X270.6 Y259.2 F4800
What this means is Z is still equal to Z3, and doesn't go to the proper location until the start of 2, when G1 Z0.4 F1000 moves the T1 nozzle back to the correct height.
I use Cura for my IDEX machine, and on the move following a tool change Cura re-writes the current Z position, so I don't see this issue (I have my tfree set up in a similar way as you, where I move the print head in it). What we should be doing (I think) is using the G1 command with a R2 and Z0 in your tpost0.g and tpost1.g
https://docs.duet3d.com/User_manual/Reference/Gcodes#g1-controlled-linear-move
Example: G1 R2 Z0. This will move the tool head back to the printing Z height.