Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:49:2

O you who have believed, do not raise your voices above the voice of the Prophet or be loud to him in speech like the loudness of some of you to others, lest your deeds become worthless while you perceive not.  

The following was revealed regarding those who raised their voices in the presence of the Prophet (s): O you who believe, do not raise your voices — when you ˹want to˺ speak — above the voice of the Prophet, when he is speaking, and do not shout words at him, when you ˹wish to˺ confide in him, as you shout to one another, but ˹speak˺ lower than that, out of reverence for him, lest your works should be invalidated without your being aware, that is to say, for fear of this ˹happening˺ as a result of the raising of voices and the shouting mentioned.
القرآن:٤٩:٢

يَا أَيُّهَا الَّذِينَ آمَنُوا لَا تَرْفَعُوا أَصْوَاتَكُمْ فَوْقَ صَوْتِ النَّبِيِّ وَلَا تَجْهَرُوا لَهُ بِالْقَوْلِ كَجَهْرِ بَعْضِكُمْ لِبَعْضٍ أَنْ تَحْبَطَ أَعْمَالُكُمْ وَأَنْتُمْ لَا تَشْعُرُونَ  

{يا أيها الذين آمنوا لا ترفعوا أصواتكم} إذا نطقتم {فوق صوت النبي} إذا نطق {ولا تجهروا له بالقول} إذا ناجيتموه {كجهر بعضكم لبعض} بل دون ذلك إجلالا له {أن تحبط أعمالكم وأنتم لا تشعرون} أي خشية ذلك بالرفع والجهر المذكورين، ونزل فيمن كان يخفض صوته عند النبي ﷺ كأبي بكر وعمر وغيرهما ؓ.