Al-Husayn ibn Sa‘id from Faddalah from Abu al-Maghra, who said:
I asked Abu Abdillah عليه السلام, peace be upon him, about a man who is behind the Imam (of prayer) and, due to forgetfulness, gives salam before the Imam (of prayer) does. Imam عليه السلام said: "There is no harm."
Ali Akbar al-Ghaffari
Tahdhīb al-Aḥkām fī Sharḥ al-Muqniʿah, vol. 2, p. 375