Without the workaround, its working partially
git config user.email works correctly
git config user.name doesn’t return anything causing issues
for me the workaround was a different path
"mounts": ["source=${env:HOME}/.gitconfig,target=/home/root/.gitconfig,type=bind,consistency=cached"]