Several questions here on SO reference this open jQuery UI feature request for the ability to dynamically add/remove panels from the Accordion widget. The ticket itself is m
Actually discussed behaviour was included in jQuery UI 1.10.0 (just released) and works fine for me.