Error in drupal_form_submit when taxonomy reference (tid) is set
It is possible that 24 is not a valid taxonomy term ID in the system, but I'm not sure if that's it. So I would check that using taxonomy_get_term_by_name or something. Also, and perhaps first, make sure to verify the field_gender field exists, as it might not always be there in the system and you don't want nasty bugs down the road.

// Check if field_gender field exists for node type yvb_ct1
$field_instances = field_info_instance('node', 'field_gender', 'yvb_ct1');
if (isset($field_instances['field_gender'])) :

  // Now check if the taxonomy ID is correct
  // I assume you are looking for a term name of 'female'
  if (!empty(taxonomy_get_term_by_name('female', 'gender')))
    // now try setting term reference field value

endif;


This is untested but I hope it might help get you closer.