ah, you’re looking for tabs in the front end, I thought that you were looking to dynamically create fields and add them to acf field groups.
Can you re-post the code in your previous post using the forum code tags. It’s not readable the way it is. It looks like you might have some nesting errors, but I can’t be sure.
Also, can you supply a link to the place you found the code to begin with?