It looks like `.git/refs/remotes/origin/HEAD` doesn't exist, which might explain why a fresh clone results in a detached HEAD (i.e. Git should default to being on the branch referenced by this entry).
As for how you can end up in such a state on the remote, I'd actually be interested to know too.
As for how you can end up in such a state on the remote, I'd actually be interested to know too.