Since Blockly's configuration is always global, only the first initialized Block Based Code widget makes changes to its configuration (other instances see that it is already configured and do not change anything). This configuration includes how to handle dialog boxes. Thus, they are always displayed in the same widget. Worse, if this original widget gets deleted, they are not displayed anywhere anymore.
Steps to reproduce:
- Create multiple instances of the Block Based Code widget
- Try to open a Create Variable dialog in one of the later created widgets
- Notice how the dialog opens in the first widget