In order to use update_field() you would need to include all of the rows of the flex field as well as all of the rows of the repeater.
$flex_field = array(
array(
// each row of the flex field
'field_XXXXXXX' => array(
// nested repeater field
array (
// each row of the repeater
'field_YYYYY' => 'value'
)
)
)
);
This is not the way to add a row to a repeater nested in a flex field.
See add_sub_field_row() and/or update_sub_field().