Error occurred during calling the sampler; sampling not done

Is it typical to have the rng inside of your .stan file this way?

generated quantities{
  vector[N] sim_Y;
  for (n in 1:N)  sim_Y[n] = normal_rng(mean(xb), sig)';
}