my first guess is your using USE_BOX in the trace code mode, which doesn't work the same how it did with the older trace

you will ahve to trace from the min_z down or subtract the origin.z to min_z distance from result of the trace to get the similar result