Hi @julson
The issue here is that your custom code is not saving the reference field which links the ACF value to the ACF field.
Please use the update_field function to better save the custom fields:
http://www.advancedcustomfields.com/resources/functions/update_field/
Thanks
E