Use attached to reproduce:
1. Click the button
2. Change the tab and go back to the diagram
Workaround:
Add the layout before showing the form