In zsh, =cmd is a filename expansion operator that expands to the path of the cmd command. =cmd is similar to $commands[cmd].
So here, with == in one of the arguments of the [ command, that expands it to the path of the = command. As there's no command called = in your $PATH, that causes an error.
Compare:
$ echo =ls
/bin/ls
$ echo =junk
zsh: junk not found
The equality operator in the [ command is =. The [ command only does tests, it doesn't do any assignments, so there's no need to differentiate between an assignment operator and an equality comparison operator like there is in some other languages (with = vs == like in C or := vs = in some others, etc).
So it should just be:
[ "$USER" = root ]
Still the [ of zsh, like that of ksh also supports == as an alternative to =, but unless you disable the equals option (like it is in ksh emulation), you'd need to quote at least the first = to avoid that =cmd operator:
[ "$USER" '==' root ]
Note that while $USERNAME is automatically set by zsh, $USER is not (though it is set as an environ variable by some things like login).
To test whether you have superuser privileges, it's more robust to check that your effective user id is 0, which can be done in zsh or bash with [ "$EUID" -eq 0 ] or (( EUID == 0 )).
See also: