The problem was to do with environment variables. The clue here was the fact it worked on the command line and not in whatever environment gets spun up by whatever runs the git hook.
So I put the env command in the script, and noticed GIT_DIR=".". This explains the cryptic error message fatal: not a git repository: '.'. Sure enough, setting GIT_DIR is a thing and there is a command line option to override the environment variable.
Thanks also to Raphael Ahrens who in the comments pointed out the incorrect period at the end of the command git pull .. The command to do the pull now looks like GIT_CURL_VERBOSE=1 GIT_TRACE=1 git --git-dir="/home/git/bubblegum/.git/" pull -v and this seems to be doing okay.