A centuries-old temple in Tamil Nadu has long been associated with a belief that a person’s life story is already written.