In the Shulchan Aruch, the laws of Rosh Hashana begin with the words, "It is the custom to rise early in the morning to recite Selichos and supplications." The inclusion of this paragraph is exceptional - as a rule, the Shulchan Aruch does not mention customs. Why was this included here?
The Selichos service marks the beginning of the yemei hadin, the days of judgement. The word din in fact has two meanings - both "law" and "judgement".
If a custom is contrary to a law, the rule is that custom overrides the law. Perhaps the author of Shulchan Aruch, Rabbi Yosef Karo was hinting that our custom of rising early for Selichos should override and set aside any harsh din - judgements - that may be decreed.
(Rebbe Shalom of Belz)