Yes, something like that. You just add the fields to the group dynamically. I don’t have an example the relates specifically but using the functions in ACF you can dynamically build field groups https://www.advancedcustomfields.com/resources/register-fields-via-php/