I am not convinced that this is totally random.
If you create a new sim from a randomly generated sim then this is the case.
However, recently I have been used the same base sim from the library of pre-made sims (EA created). I used this to make a large family of siblings. Everyone of them came out within at least 40 days (long life span), which is pretty close to the maximum. So, I did it again, with the same sim and got the same result. So, I then used cheats to return one sim to teen in CAS then immediately after I cheated to give the sim a birthday. Next I returned this sim to CAS and saved her to the libray. There is a little variation in age if I use this sim to make a new sim, but, so far, it is only a couple of days. I accept, this may be coincidence and needs further checking. If you use the create a twin tool, however, rather than selecting the sim from the libray each time, the total random factor is restored.