Tricky problem, how to move unit length on custom orientation by script?

I was trying to move an object by an unit length, say 0.5mm
but by try
bpy.ops.transform.translate(value=(0, 0.5, 0), constraint_axis=(False, True, False), constraint_orientation=‘axes-1-2’)

it seems will not always give me the right 0.5mm, the actual distance is 0.4mm, 0.34mm such as that
i understand the axis i created has an angle difference from the local axis
but is there any easy way to get and set a unit length, follow the constraint orientation?

when i using the custom orientation, if i drag any of the axis, the bottom down menu will
be update something like

D:0.401mm(0.401mm) axes-2-1

Many thanks!