Warning: Creating default object… when altering Customize panels

Turns out $wp_customize->get_section( 'sidebar-widgets-footer_widgets' ) was returning an Array, although a quick print_r() makes it seem as though it was an Object.

Anyhow. Simple fix: cast it to an object.

$footer_widgets_section = (object) $wp_customize->get_section( 'sidebar-widgets-footer_widgets' );
$footer_widgets_section->panel="";