Problem with "echo ~ && sleep 0"

What was the difference that caused Ansible to fail?