Yes, a supererogatory act of worship makes up for any shortfall in an obligatory one, whether it is Salah, Sawm (fast), Zakah (obligatory charity), and so on. It is
authentically reported by
Ibn Majah, and
on the authority of
Tamim Al-Dary that the Prophet (peace be upon him) said:
The first thing that a servant will be asked about on the Day of Resurrection will be their Salah. If it is found perfect, it will be recorded as perfect. But if something is lacking, He (Allah) will say (to the angels), 'See if My Servant has any voluntary Salah to make up for the shortfall in their obligatory Salah.' Then all the deeds will be reckoned similarly.
(Part No. 7; Page No. 236) Hadith Sahih (authentic Hadith).May Allah grant us success. May peace and blessings be upon our Prophet Muhammad, his family, and Companions.