Look at the attendance data for this student in the month prior and after the leaving date (on the Attendance tab, you can click on the Attendance Date Range report if in the previous academic year.)
Amend the leaving date to the last day attendance data was recorded, then save at the base of the extended tab.
NOTE: Student leaving dates cannot be on or during a school holiday period. To check school holiday dates go to Admin > Config > Core Setup > Holidays.