For more than a year, the employee was on unpaid leave, right? Was that leave regularized or was the leave approved? If yes, the date of death, i.e., 11th Dec 2023, should be considered as the date of termination of employment for calculating gratuity. If the leave was not approved and not regularized as continuous service, then his last working day, i.e., 23-05-2022, should be the cutoff date for calculating gratuity.
If the leave from 24th May 2022 was not approved, you should have initiated some disciplinary action against the employee. That would make the service between his last working day and the date of death unregularized.