It seems the .grad attribute wasn’t populated so you might have accidentally detached some tensors from the computation graph.
Could you check the .grad attribute of other layers and make sure you see valid values?
Also, don’t use the .data attribute, as it may yield unwanted side effects.
Alternatively to your current workflow you could also use hooks via model.bn.weight.register_hook to manipulate the gradients, but this wouldn’t solve your current issue.