I am sorry, but I cannot follow:
In both cases I iterate through model.layers.parameters() and change the weights in this loop. I do not directly change anything in the cached model.state_dict() in the first case as you imply with your last example. What am I missing?
EDIT: Is the difference in accessing an individual index (layer.data[index] = 0)  compared to updating the whole layer with a new object (layer.data = torch.zeros_like(layer.data))?