You are doing it wrong:
In Terminal DON'T login to the remote machine.
Just run:
scp user@remote:<path>/error.txt /Users/myname/Desktop
In other words: Run SCP locally on your Mac and tell it to retrieve the file from the remote machine.When you are already logged in on the remote machine you need to scp from local (which is the remote machine in that case) to a remote machine (which is your Mac in that case).