A field does not store information like this about the field group it is in, not directly. A field stores the key of its parent. This could be another field or a field group. In the case of a flex field it could also be a layout key. To get the name of the group you would need to get the parent field, this would need to be recursive when dealing with sub fields, and then when you find the group you’d need to get it to extract the name.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users