How do I programmatically add a field to an existing fieldset that's part of the user entity?
I think you should try hook_form_alter. try this may it helpful to you.

function mymodule_form_alter(&amp;$form, $form_state, $form_id) {

  // Check your form-ID 
  if ($form_id == 'user_profile_form') {
    // Creating custom field
    $form['new_field'] = array(
      '#weight' =&gt; 4,
      '#type' =&gt; 'textfield',
      '#title' =&gt; t('New Field Name'),
    );
  }
  // Attach to the existing group
  // Suppose group machine-name is group_general
  $form['#group_children']['new_field'] = 'group_general';
}