Errors with sampling

You should use pytensor.tensor operations and not numpy. There is a pytensor.tensor.linspace (and almost any numpy function you may need)