An agreement with the Commissioner of Social Services under § 17b-267 may be terminated: (1) By the agency or organization which entered into such agreement at such time and upon such notice to the Commissioner of Social Services, to the public, and to the providers as may be provided in regulations of the Commissioner of Social Services, or (2) by the Commissioner of Social Services at such time and upon such notice to the agency or organization, to the group or association of providers which have nominated it for purposes of § 17b-267, and to the public, as may be provided in said regulations, but only if he finds, after reasonable notice and opportunity for hearing to the agency or organization, that (A) the agency or organization has failed substantially to carry out the agreement, or (B) the continuation of some or all of the functions provided for in the agreement with the agency or organization is disadvantageous or is inconsistent with the efficient administration of the medical assistance program.