If you setopt ignorebraces you'll see that all five examples work the
same and always leave the extra } at the end.
Unless I misunderstood, adding 'setopt ignorebraces' to the function, returned the
same results as it did without it. Don't know if that helps, or confuses things more.
Regards,
Jim