It goes along the lines of what is mentioned in a lecture and on the internet, which is not the Hadith mentioned in Sahih Muslim (190a), but is still somehow similar to this following narration (if it is true):
The story: The Prophet (ﷺ) laughed one day and so his Sahabah asked: "What are you laughing about?" He said: "I was looking into the Day of Judgment" - and every time the Prophet (ﷺ) saw the Day of Judgement, he would (usually) cry or panic and worry for everyone. But this time, he smiled and he said: "I laughed because the People, on the Day of Judgment, a group of them will laugh", they asked: "Who are 'they'" and he said: "They are People on Judgement day who will laugh", and the Sahabah asked: "Who are 'they'?" The Prophet (ﷺ) said: "They are people who committed sins and they will laugh on the Day of Judgement [...] and people will ask them what they were laughing about. They will say: "We've sinned [...] and we repented [...] and our sins became good deeds!"