Thanks for the bug report. The menu creation routine is really old, so it is difficult to say for sure, but it looks like it was designed to continue to try creating the menu even if there was an error in the menu definition. I am not sure I can change this behaviour now without breaking scripts unfortunately.