Xcopy doesn't give an error, it just shows the message that usage is deprecated in the help message.
Robocopy is vastly superior to xcopy anyway and well worth using if you have to script a file copy. Even if only for the ability to use restartable mode and backup mode.