As phd said in his comment what was missing was this:
unset $(git rev-parse --local-env-vars)
before
test=$(cd ../../; git remote -vv | grep 'my_special_repo')
so that environment variables like GIT_DIR are reset and therefore the hook's script works as expected. This is based on this answer.
PS: Now that it works I reworked my script to its more appropriate form (in my opinion):
test=$(git -C ../../ remote -vv | grep 'my_special_repo')