Hitting a weird error to do with RNGs in Scan in a custom function inside a Potential

Can we get something a bit more minimal?