You have CR (^M) characters in your script. Convert it to have Unix end-of-lines (only LF). In a portable way:
tr -d '\r' < your_script > output_script
Some explanations based on Olivier Dulac's comment about what happened with CR characters: First, in the shell language, the CR character is not regarded as a special character, e.g. not regarded as a space and not ignored. I write it as ^M below.
In the echo $HOME^M line, the content of $HOME followed by ^M followed by a new line was output. Outputting the CR character put the cursor on the first column, but since it was immediately followed by a newline, this had no visible effect.
In the cd $HOME^M line, since there is no space between $HOME and the CR character, they are both in the same argument $HOME^M, and this directory does not exist. In the error message, the CR character after $HOME was just output, putting the cursor on the first column, so that the beginning of the line was overwritten by the rest of the message if any: ": No such file or directory" with bash (your first example), nothing with dash (your second example sh script.sh, as #!/bin/bash was ignored since you explicitly asked to run the script with sh, which seems to be dash in your case). The error message completely depends on the shell. For instance, zsh detects that the CR character is not printable and outputs a message like:
cd: no such file or directory: /usr/local/src/^M
(with the characters "^" and "M", not the CR character), which allows one to detect the cause of the problem much more easily. Otherwise you need to redirect/pipe stderr to some utility that can show special characters such as cat -ve as suggested by Olivier, or to hd, which gives the byte sequence for the stream.
#!/bin/bashif you run the script assh script.sh.dos2unixcommand.