Sorry, Prabhat, to differ from your view point and calculation of the length of service of the poster.
First, since the calculation of the actual length of continuous service is for the purpose of determining the eligibility for gratuity under the Payment of Gratuity Act, 1972, your reference to section 25-B of the ID Act,1947 instead of sec.2-A of the PGA,1972 is not necessary though the two sections are in pari materia.
Secondly, under both the Acts, the calculation has to be done with effect from the date of termination of employment and not from the date of joining of the employee. In other words the calculation is to be done by commencing and counting backwards from the relevant date i.e., the date of termination of employment which is the date of relieving from the establishment. Hence the length of service of the individual in the establishment is 04 Years-08 Months-18 Days i.e., (2021-05-05) -- (2016-08-17). Effectively, thus, the poster had worked for 4 years and 258 days in the fifth year. Therefore, by virtue of the deeming provision of sec.2-A of the PGA,1972 the poster is qualified for gratuity under the Act.
Thirdly, sec. 2-A mandates that the interruption in service due to holidays, authorised leave and the like is to be treated only as non-interruption for the purpose of calculation of 240 days in a period of preceding 12 months. Hence the contention of the employer is not correct.
If the employer still maintains his stand and refuses to pay gratuity on this ground, the poster may file a claim for gratuity together with interest for the period of delay before the Controlling Authority under the Act for the area where the establishment is situated.