Wa alaykum salam
In 53:32, Allah (swt) tells us not to consider ourselves sinless, pure, free of error. He knows us the best at any moment of our lives, from the wombs of our mother to our graves. He knows every thought that crosses our mind (good or bad) and whether we act upon them or choose to ignore them. So He tells us, "do not think of yourselves as impeccable, errorless beings". After all we are being tested here in this worldly life. We make mistakes. Allah (swt) reminds us that we are indeed fallible.
Claiming to be pure and faultless is actually a bit different from talking about our good deeds. We all know what is good to do or not, alhamdulillah by the favour of Allah (swt) upon us. He gave us the Reminder (Quran).
Furthermore, talking about good deeds does not necessarily mean bragging about them. In 12:90, Prophet Joseph (pbuh) does not present himself as pure and infallible, also he does not brag about himself. He was talking to his brothers who did terrible things against him when he was little. They also lied to their father Prophet Jacob (pbuh) about Prophet Joseph (pbuh), keeping him unaware of his little boy for years and causing him to suffer a lot ! Just because of their jealousy!
So he acknowledges that he and his little brother got together because Allah(swt) favored them. Then he gives advice about how Allah(swt) helps, protects and favours those who keep their faith in Allah (swt), who remain patient and continue to do good things (implying that Allah (swt) always favours those who keep themselves away from evil, trying to make his older brothers realize their bad deeds.)
"And proclaim the blessings of your Lord." (93:11)
Remembering that:
"There is no doubt that God knows what they conceal and what they reveal. He does not love the arrogant". (16:23)