Not sure if you have this solved or not, the code is hard to follow in the format you posted.
If your add_sub_row(‘link’, $row); call is not updating the field try using the field keys instead of the field names for your loop. When data for an ACF field does not already exist using the field names when updating fields will not work correctly.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users