pm.Deterministic remains unchanged although the parameters are changing

You’re right that p should be updating. I think this is related to how random number generation was handled inside Scan Ops in v3. Can you upgrade to v4? This issue was fixed when the asesara team did a large refactoring of how random variables work inside computational graphs. Otherwise you’ll have to dig up the old documentation about how to handle this situation.