This error occurs when you are checking out a remote branch that your local git repo is unaware of. To solve this, run:
git remote show origin
If the remote branch you are trying to checkout is specified under "New remote branches" and not under "Tracked remote branches" then you have to fetch the branch first, follow the below commands:
git remote update
git fetch
Now try:
git checkout -b local-name origin/remote-name