Oh, you use the same parameters (vor a list oft filtered parameters).
You would geht the separate gradients by
opt1.zero_grads()
loss1.backward()
opt1.step()
opt2.zero_grads()
other_loss.backward()
opt2.step()

so that opt2 is ignorant of loss1’s gradient and opt1 of other_loss's.
Best regards
Thomas