get_template_directory()
returns a filesystem path– that is, it returns the path to the file as it would appear if you were browsing it on the local machine via a file browser.
Return Values
(string)
Absolute path to the directory of the current theme (without the trailing slash).https://codex.wordpress.org/Function_Reference/get_template_directory
That is what you are seeing. The function works correctly (based on my interpretation of your question, anyway).
You want get_template_directory_uri()
instead, which will give you a path relative to your web server root and which is what get_bloginfo('template_directory');
gives you.