@TIG
This looks like a problem already encountered by a few users about the persistence of menu structures in the API on Windows.
As I was not able to reproduce it, I never understood the root cause and I never found a fix for that. Just detect the issue (hence the Ruby console message).
For information, this is anyway fixed in SU2023 and above, because Sketchup changed the way it handles menus in Windows.