code: protected function fixDefault(CustomerGroupInterface $customerGroup)
      {
          if (!$this->persistenceHelper->isChanged($customerGroup, ['default'])) {
              return;
          }
  
          if ($customerGroup->isDefault()) {
              try {
                  $previousGroup = $this->customerGroupRepository->findDefault();
              } catch (RuntimeException $e) {
                  return;
              }
  
              if ($previousGroup === $customerGroup) {
                  return;
              }
  
              $previousGroup->setDefault(false);
  
              $this->persistenceHelper->persistAndRecompute($previousGroup, false);
          }
      }
docs: Fixes the default customer group.
  
  @param CustomerGroupInterface $customerGroup