It turns out I was missing a file called _sqlite3.cpython-311-x86_64-linux-gnu.so
from the lib-dynload library located at /home/katmatzidis/.pyenv/versions/3.11.10/lib/python3.11/lib-dynload. This is what the error means by ModuleNotFoundError: No module named '_sqlite3'.
I found a copy of the file from the Spyder6 internal python files at /home/katmatzidis/spyder-6/envs/spyder-runtime/lib/python3.11/lib-dynload and copied it to my lib-dynload library and the IPython console and it worked.