Also @jonsedar when using scan it’s always a good practice to set strict=True and pass all sequences/non-sequences explicitly. Apologies if you are already doing that.
Specially the non-sequences should help PyTensor to understand there are no RNGs needed inside the Scan