Posterior predictive check question

Sigma is not varying. As you said, you have fixed it to be exactly true_sigma_of_generating_process = 2. However, you are not plotting obs (which is normal by definition). Instead, you are plotting posterior draws from obs. In fact, you’re not even plotting posterior draws from obs, you are plotting a KDE of posterior draws from obs. So what you are seeing is an approximation (KDE) of an approximation (draws from a normal distribution) of obs. If you want to see something closer to what you expect, you can just take the one free parameter from your model (mu) and pump it through the true data generating process (the process that is also reflected in your model):

mus = az.extract(idata, var_names="mu", num_samples=100)
x = np.linspace(-5, 15, 100)

for mu in mus:
    plt.plot(x, stats.norm.pdf(x, mu, true_sigma_of_generating_process), c="b")
plt.show()