compare your parameter list with the ones that are posted here under heidenhain parameter lists. look at the section related to z axis direction AND homing direction. If these are both swapped it might account for your error