This is merely a guess based on the error message but I wonder whether you are running into the same error as 2.16.1 and adapt_delta.
That thread seems to indicate that using control = list(adapt_delta = 0.8)
leads to some problems with rstan 2.12.2
. You could delete the control
argument to test. The thread also indicates that switching to cmdstanr
might be an option.