The cwd for that shell command will be based on the default-directory
for the active buffer at the time your file is loaded; not the directory in which the loaded file resides.
You need to utilise the load-file-name
variable.
(let ((default-directory (file-name-directory
(expand-file-name load-file-name))))
(shell-command-to-string ...))
(let ((default-directory (file-name-directory load-file-name)))
(shell-command-to-string ...))