How to use custom code to change the node form layout and group fields while maintaining values?
$form_state is an object, not an array. You should be able to get the values like $my_value = $form_state-&gt;getValue('custom_group'). Or get all values like $values = $form_state-&gt;getValues().

See: Introduction to Form API