I don’t know, how the losses were calculated, but both approaches should yield the same result, if no parameters are shared between the optimizers.
To verify it, you could seed the code, run a single iteration using both approaches, and compare the gradients and final parameters in both runs.
Also, it seems you are clipping the gradients too late, as the optimizer already performed the step method.