You have to make sure that all unit enrolments record under the course that you are about to set as completed are set in their final statuses first before you will attempt to close the course enrolment status otherwise it will trigger tcsi validation errors when trying to close a course that has units still open.
(1) Refer to this article on how to change a unit enrolment status.
(2) After finalising all unit enrolment statuses, you can now set the course enrolment end date and mark the course enrolment record as Completed.
Additional Guides:
You also have the option to check on the following screens of the student record related to completion: