Assalamualaikum waramatullahi wabarakatuhu
Forgiveness is something that our prophet tell us to always do as he said that
Abdullah ibn Amr reported: The Prophet, peace and blessings be upon him, said, “Be merciful to others and you will receive mercy. Forgive others and Allah will forgive you.” (Musnad Ahmad),
So I don't think the idea of not talk to some ...
As far as I looked, there is no hadith specifically like the one you quoted that mentions "Alhamdulillah" in good and bad situations.
However, as commented by UmH already, there is a hadith similar to what you are looking for but it is about the Prophet (SAW):
"When the Messenger of Allah (ﷺ) saw something he liked, he would say: 'Al-hamdu ...