I have seen this error before and it seems to be a Tracker issue with large loops. Zygote doesn’t have this problem. If you go on Turing#master you can use Zygote for AD with:
using Zygote, Turing; Turing.setadbackend(:zygote)
However, Zygote will take a lot of memory when compiling the gradient the first time.