It had a ^M at the end of the shebang. Converted using recode to unix format. Hard to see, but using a hex dump, you see the 0d 0a sequence:

23 21 2F 62 69 6E 2F 73 68 0D 0A 23 _0D 0A 0D 0A_ #!/bin/sh..#....