So the problem was that Python 3.12 is now out so the patchelf commands for Python 3.11 no longer work. I'll amend the script, but you can probably get it to work by running the following (without having to start from the beginning...)
_file="$(find $PREFIX/lib/python3.12 -name "_sysconfigdata*.py")"
rm -rf $PREFIX/lib/python3.12/__pycache__
cp "$_file" "$_file".backup
sed -i 's|-fno-openmp-implicit-rpath||g' "$_file"
patchelf --add-needed libpython3.12.so /data/data/com.termux/files/usr/lib/python3.12/site-packages/zmq/backend/cython/_zmq.cpython-312.so