I just tried your two versions on a toy example and the losses are equal to within a few percent of each other. The difference may be in the clipping.