Can't use docker remote API with Daemon in debug mode

I have been trying to debug an issue where calling /containers/create returns a 500 error with the log saying ‘level=error msg="Handler for POST /containers/create returned error: EOF’.

So, I am trying to run the daemon in debug mode to get more detailed info about what is going on. I stop the daemon with
sudo systemctl stop docker

and then run
sudo dockerd -D

This prints out a whole bunch of info, ending with…
DEBU[0002] Registering POST, /networks/prune
DEBU[0002] Registering DELETE, /networks/{id:.*}
INFO[0002] API listen on /var/run/docker.sock

However, I cannot successfully send commands in through the remote API any longer. Is this expected and what am I doing wrong?

Thanks