custom field caching is not group-specific
CRM_Core_BAO_CustomField::getCustomFieldID() is used to retrieve custom field IDs based on the name/label of the field. But it caches these values based solely on the field name. That's problematic because field name uniqueness is only required per custom group. Fields could exist in different groups with the same name and/or label, resulting in this method returning the wrong custom ID.