Without the print statement your model isn’t learning at all?
Once you add print to your training loop, the loss goes down to zero?
Have you tried to fix your random seeds and run it again with and without the print?
Is this issue reproducible on your machine?
The print statement should not change anything in your training.