This may be caused by changes in macOS Monterey, where parts of the system tooling and libraries that older versions of Python expect aren't available by default.
I think you could try to use Homebrew to install libraries required by Python 3.6, which aren't available out of the box. Then let pyenv know where to find these dependencies. Finally, attempt to install Python 3.6 using pyenv again.