Calculating the total time elapsed until two pendulums "stop colliding" gives a divergent result
Your calculation is perfectly correct, under the standard idealizations in mechanics.
From a mathematical point of view this isn't that surprising; divergent times are pretty common. For instance, for a generic nonsingular drag force like $F = - bv$, the time it takes anything to stop is infinite. In that particular case, the velocity decays exponentially, so it never hits zero. Things do come to a stop in real life, but that's just because the force law is not accurate at small velocities.
In your case, the idealization that breaks down is that collisions are instantaneous and the particles are pointlike. In reality, collisions take time and involve deformation of the objects involved. At some point, you will have so little energy left that the objects will just be continually in contact while simultaneously wobbling at each other, so the whole notion of discrete collisions breaks down.
Perfect simple harmonic motion takes the same time per cycle regardless of amplitude. Since your model predicted an infinite number of cycles, they take infinite time.
In the real case, there aren’t an infinite number of cycles: at some point, they’re small enough to be negligible. At a minimum, that happens when the amplitude and/or velocity decays to be less than the thermal motion.