@dc42 First of all thank you for pointing me to the right thread.
I'm using a DuetWifi with the latest firmware 2.02 to control a CNC router and experience the same problem in the CNC context.
T0 ; select tool 0
G0 Z50 ; move to position Z50, position shows Z50
G10 P0 Z0 ; set tool lengths of tool 0 to 0
G10 P1 Z10 ; set tool lengths of tool 1 to 10
T1 ; select tool 1, position still shows Z50 instead of Z40
G91 ; go to relative positioning
G0 Z0 ; no movement is expected to occur however Z moves down 10 and now correctly indicates Z50
T0 ; select tool 0 again, position shows Z50 instead of Z60
G0 Z0 ; again no movement expected but Z moves up 10 and again correctly displays Z50
As explained by @dc42 the Z position is not updated after a tool change and with the first G0/G1 move the difference is noticed and compensated by an according move which obviously can make sense in a scenario when a tool change is executed between two tools / heads with very similar length.
However in a CNC setup this behavior is wrong and potentially dangergous as it leads to unexpected Z-movements which are not alwyas small as tool lengths can greatly vary (and believe me it is not fun when my 3.5t Mikron with a maximum table load of 1.1t makes unexpected moves... ;-0000
However I'm even doubtful that it is a good behavior for a dual head printer as the z-correction done with the first G0/G1 move (typically resulting in a slanted move) can potentially lead to a collision with already printed material when switching from the longer to the shorter tool. I think the Z-move to the correct height should be executed before any other movement. Therefore in my opinion @dc42 's first proposal (Require that all users of multi head FDM machines use tpost#.g files with a G1 R2 Z0 command at the end of each one) would be the way to go.
However I learned that selecting the tool twice is a work-around that is kind of solving the problem for me at the moment. But longer term there should be another solution as it is awkward and kind of hard to explain to CNC guys why the should always do two tool changes...