The purpose of Namaaz is to soften our hearts and make us better human being.
Quran 29:45 makes it clear that stops us from committing sins.
“CONVEY [unto others] whatever of this divine writ has been revealed unto thee, and be constant in prayer: for, behold, prayer restrains [man] from loathsome deeds and from all that runs counter to reason; and remembrance of God is indeed the greatest [good]. And God knows all that you do”
What you heard from the Maulana is true.