How can I replace A model's params and get the grad correctly?

That’s expected since you are creating a new nn.Parameter without a gradient history.
You could check this post to see if parametrize would work.