Origin of the Optical Anomalies Near the Ferroelectric Phase Transition in SbSI and SbSBr Crystals