Possibly a mismatch between pygobject and your installed Python? Pygobject is a CPython module, so it needs to match the version of Python on the system.
It only appears for Flatpak package, published to FlatHub, so, the PyGObject and Python all come from the org.gnome.Platform 47. I don’t modify the Python and PyGObject there.
Fixed it. The reason is that, the app uses a Python library which is built with Cython. But in the Flatpak package, I added the wrong version of Cython and CFFI (added the ones for Python 3.11 instead of Python 3.12, which is the Python of the org.gnome.Platform 47 runtime).