I am using a volume when running a docker container with something like docker run --rm --network host --volume $PWD/some_dir:/tmp/some_dir .... Inside the container I am running Python code which creates the directory /tmp/some_dir (overrides it in case it's already there) and puts files into there. If I run the docker container on my local dev machine the files are available on my dev machine in /tmp/some_dir after running the container.
However if I run the same container as part of a gitlab-ci job ("docker in docker", the container is not the image used for the job itself) the files are not accessible in /tmp/some_dir (the directory exists).
What could be a reason for the missing files?
Did you checked the good directory on the good server ? 
Creating a $PWD/some_dir in a DinD context, The result should be in a some_dir created in docker user home dir in the server running Gitlab CI container.
Share directory in docker container with parent scope docker container in gitlab-ci?