You are getting weird results because you misuse $iif.
$iif(condition,true,false)
You forgot to put a comma after the condition, to seperate the condition from the actions. Also it's not a good idea to use brackets in an identifier like that, they aren't needed even.
What you are looking for is:
//echo -a $iif(0,echo -a hello,bye)
//echo -a $iif(1,echo -a hello,bye)
which are both processed correctly.
Even using brackets, it gave the required result:
//echo -a $iif((0),echo -a hello,bye)
//echo -a $iif((1),echo -a hello,bye)
which were both processed correctly.
However, don't use brackets in the if condition nevertheless.
Greets