Yes, I have separate loss functions.

So do you have a separate loss function for model1’s ouput and it is only model2 that should be optimized to minimize the MSE between gradients and its outputs?

Yes, that’s somewhat I want to do, but want to optimize both the models simultaneously.