Bug in MenuBar MenuItem visibility- workaround suggestions requested

I have just created an issue https://github.com/vaadin/flow/issues/16672
I am urgently looking for a workaround until a fix is released. Does anyone have any ideas for a workaround please?

Only add the needed menu items instead of playing with visibility.

Thy for the suggestion. This would unfortunately need a bit of a rewrite. I have a large application that I am porting from 14 - this bug does not appear in 14. The menubar is used as a toolbar for many grids. Depending on the item selected in the grid, different menu options are available. This would mean that whenever an new grid row is selected, the menubar needs to be removed and recreated. Any ideas for something simpler. The other strange behaviour is that if an already visible menuitem is set to visibility(false), then suddenly the bug goes away and all other visibilities work properly. I have been experimenting with trying to add a visible menu item but somehow hiding it in another way?