Prior sample from TruncatedNormal gives inf

I have made a model with the following observed value, obs:

 pm.TruncatedNormal("obs", mu=multiplier.T * pred + means_vector, sd=err_sd, observed=self.df['mean_log_gfp_live'].to_numpy(),
                               lower=0.0, upper=12.0)

I then sampled from the model using sample _prior_predictive().
I was quite surprised that many of the sampled values are apparently np.inf or -np.inf. Shouldn’t this be impossible because of the truncation? Or at best, shouldn’t this give a runtime error?
When I checked, 1977 of my 5000 samples have at least one of their values (observed is a vector of 1043 elements) either inf or -inf.
Probably this means there’s something wrong with my model, but this also suggests that this variable can behave oddly in prior sampling.

The sd variable is a HalfNormal – is there any chance that this is going awry when I get too high a sample there, and we hit this code in the TruncatedNormal sampler:

      return generate_samples(stats.truncnorm.rvs,
                                a=(a_v - mu_v)/std_v,
                                b=(b_v - mu_v) / std_v,
                                loc=mu_v,
                                scale=std_v,
                                dist_shape=self.shape,
                                size=size,
                                )

If that’s the case, should we do something to trap this, even if it’s only trapping infinite outputs from the various rvs methods?
And is there something I should be doing to limit my err_sd to keep this from happening?

hmmm this sounds like a bug.

Thanks for letting me know. I will try to isolate a test case.