Has this been submitted as a bug or is there something intrinsically incompatible with adding a contentpanel to an according after it has been attached?

I built a data driven AccordionLayoutContainer. When I was mocking the data locally everything worked fine. But when I wired this to the backend, I got the assert error because I am now fetching the data async.

The problem happens when you add the contentpanel to the accordion in this code:

@Override
protected void onInsert(int index, Widget child) {
super.onInsert(index, child);
assert child instanceof ContentPanel : "AccordionLayoutContainer must be ContentPanels";

ContentPanel cp = (ContentPanel) child;
cp.addBeforeExpandHandler(handler);
cp.addExpandHandler(handler);
cp.setCollapsible(true);
cp.setHideCollapseTool(hideCollapseTool);
cp.setAnimCollapse(false);
cp.setTitleCollapse(titleCollapse);
}

the cp.setCollapible does


public void setCollapsible(boolean collapsible) {
assertPreRender();
this.collapsible = collapsible;
}

protected void assertPreRender() {
assert !isOrWasAttached() : "Method must be called before the widget is rendered";
}

protected final boolean isOrWasAttached() {
return eventsToSink == -1;
}