I don’t quite understand the outputs at the moment.
For the original model, did you see zero gradients in the embedding after creating the model and before the first backward or zero_grad call?
If so, then some other issues are in the code, since the .grad attributes are not filled with zeros by default and some code is apparently manipulating these .grad attributes.
The smaller model has apparently introduced an issue, which is now detaching the gradient for the embedding layer (or is now showing this issue at least).
Could you post this small model, so that we could have a look?