It should work. It sounds like a misconfiguration of the server. Is it just in your local environment?
EDIT: I just saw your update. I’ll post an update to that shortly.
EDIT 2:
I’m not sure how SERVER variables are set when running a shell command, but in your console.php config file, you could force the correct host info by adding the following: