Here's what you may find in earlier S12D family ECT block guide
Write has no meaning or effect in the normal mode; only writable in special modes (test_mode = 1).
We usually debug with BDM pod in special mode, that's why TCNT=0; works. Of course it won't work in normal mode, write to TCNT , TCNT=0; will be always ignored.
You may fix your code easily. Instead of clearing TCNT you may just note the TCNT count, and later subtract it from new TCNT value. Modified code should work in both modes: