Did you compile with Python 3.13 instead of 3.12, please check with this command:
python3-config --extension-suffix
try recompiling with this command:
CXXFLAGS="$(python3.12-config --cflags)" LDFLAGS="$(python3.12-config --ldflags)" cmake ..
make