Your pyenv might not be up to date. Try upgrading pyenv by running:
pyenv
pyenv update
Once updated, try installing Python again:
pyenv install 3.12.8
Let me know if this resolves the issue!