(Magento 2.2.6) Hi, normally when you remove attribute group from an attribute set you still see the attributes that belonged to the group under "Unassigned Attributes" section of attribute set edit page on adminhtml. I'm working on tiding up a store and want to do this programatically, I'm removing unused groups from couple sets in upgrade script with
$this->eavSetup->removeAttributeGroup( $entityTypeId, $set->getAttributeSetId(), $groupName );
The code works and removes the group from sets but unfortunately the attributes that belonged to the group are no longer visible on attribute set edit page. The attributes are definitely not removed since they are visible on sets that were not touched with the upgrade script. I've tried reindexing, flushing cache, removing view_preprocessed and pub/static (bascially everything I could think of that could affect frontend) but it still doesn't work.
Maybe someone has experiece with such issue? I'm kinda lost here because it seems that the removeAttributeGroup works as intended but I would like to add these attributes back with admin panel in the future if such need occur.