Thanks curaga for reading so carefully and bringing this to my attention. Indeed this whole command did not make sense, since the 'sudo' and the 'echo' somehow "got lost" and the double-quotes were not around the entire command.
[A bit OT] Maybe there is a better way, but this sort of command is what I use to directly write from a "user shell" to a file owned by 'root'. Surely one could simply change the shell to be a "super-user shell", but when quoting commands in posts here I assume that the user is "non-root".
Never mind it should now be correct.