I noticed few similar hadith with different words. But no words as this from our nabi(S). This is probably statement of salaf based on hadith. 2 similar hadith with different contents are below
1. وَعَنْ عَلِيٍّ رَضِيَ اللَّهُ عَنْهُ قَالَ: قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ: «بَادِرُوا بِالصَّدَقَةِ فَإِنَّ الْبَلَاءَ لَا يَتَخَطَّاهَا» . رَوَاهُ رَزِينٌ
Give the sadaqa without delay, for it stands in the way of calamity.”* Razln transmitted it. Mishkat al-Masabih 1887. Daif/Mawdu
2. إن الصدقة لتطفئ غضب الرب وتدفع ميتة السوء
Indeed charity extinguishes the Lord's anger and it protects against the evil death.
Jami` at-Tirmidhi 664