And from him, from al-Nadr, from Musa bin Bakr, from al-Fudayl, who said:
I asked Him عليه السلام about forgetfulness. Imam عليه السلام said: "In the Maghrib prayer, if you do not remember whether it was three or four (rak‘ahs), then repeat your prayer."
Ali Akbar al-Ghaffari
Tahdhīb al-Aḥkām fī Sharḥ al-Muqniʿah, vol. 2, p. 190