Custom toolbar extensions problems

That’s a recurring and random problem which I have difficulty to identify the source. It derives from a bug in Sketchup, never fixed, about menus.
Currently, I don’t know what I can do.