The models should be identical and you’ve already tested for the same outputs, so I think the code is fine.
How often did you perform your experiments? Could it be the difference in the training was just randomly better or one model?