I think the answer is, that you know where the echo command ends but cmd.exe does not
ECHO hiya >doesnotexist\notextfile.txt 2>error.txt
it thinks this is the filename to echo hiya into:
doesnotexist\notextfile.txt 2>error.txt
But this way it knows
(ECHO hiya >doesnotexist\notextfile.txt) 2>error.txt