The subcontract is administered independently from the main contract and stands alone from it, in fact there are few references in the subcontract to the main contract. It is therefore possible to have the subcontract completion date after the main contract completion date.
References in the ECS to the terms Completion and Defects Certificate are in relation to the subcontract and not the main contract and the defect date is defined as x weeks after Completion of the whole of the subcontract works. So under Option X16: Retention the first half is retained until the earlier of Completion of the whole of the "subcontract works" or when the Contractor takes over the whole of the "subcontract works" with the second half released when the Defects Certificate is issued (note the term Defect also refers to "subcontract works" so it means a certificate under the subcontract and not one under the main contract.
In your scenario this means the first half of retention will be released in July 2021 and the second half in July 2022 (assuming no early or late finish).
References in the ECS to the terms Completion and Defects Certificate are in relation to the subcontract and not the main contract and the defect date is defined as x weeks after Completion of the whole of the subcontract works. So under Option X16: Retention the first half is retained until the earlier of Completion of the whole of the "subcontract works" or when the Contractor takes over the whole of the "subcontract works" with the second half released when the Defects Certificate is issued (note the term Defect also refers to "subcontract works" so it means a certificate under the subcontract and not one under the main contract.
In your scenario this means the first half of retention will be released in July 2021 and the second half in July 2022 (assuming no early or late finish).