This will happen if the loss is linear in a parameter and thus the first gradient does not depend on it.
The quickest way to find which one is to use allow_unused=True in the grad call and then check the gradients it returns.
Best regards
Thomas