The error appears in a new container with Debian13. I tested the same command with an older container (exact same version of grass, gdal, proj and geos but based on almalinux instead of debian) and it works.
Beside black magic, I think it could be some compilation flags as in both containers all of the above (grass, gdal, proj, geos) are compiled from source. I will try to replicate the same compilation configuration on the debian container and report back.
It was difficult to pinpoint the causes of the problem. However we found out it is somehow related to python wrappers.
The solution was to create a wrapper script around grass command that:
Detects -c (new project creation) and disable python paths
unset of python envs: PYTHONPATH, PYTHON, GRASS_PYTHON, PYTHONHOME, PYTHONUSERBASE,PYTHON3PATH etc
Runs project creation and re-sets python envs
If NOT -c then it goes ahead with execution of command
Building grass --without-python also solves the problem but the python modules are then missing.