Could you post a minimal code snippet to reproduce this issue?
This dummy approach seems to work fine:
class MyModel(nn.Module):
    def __init__(self):
        super(MyModel, self).__init__()
        self.conv = nn.Conv2d(3, 10, 3, 1, 1, bias=False)
        
    def forward(self, x):
        x = self.conv(x)
        return x

model = MyModel()
x = torch.randn(1, 3, 3, 3)
output = model(x)
print(output.shape)
output.mean().backward()
print(model.conv.weight.grad)
model.zero_grad()

# prune
with torch.no_grad():
    model.conv.weight = nn.Parameter(model.conv.weight[:5])

output = model(x)
print(output.shape)
output.mean().backward()
print(model.conv.weight.grad)
model.zero_grad()