That’s a good clue - so your issue may be host_name resolution
For remote server access to pdf that must be specified in your site_config.json
To check that try this:
frappe@ubuntu1804lts:~/frappe-bench$ bench show-config | grep host_name
host_name https://exampledomain.com
To add or change that try something like this:
bench set-confg host_name https://exampledomain.com
You can also edit site-config.json manually.
Clues like this will help