Sunan Ibn Majah, Book 21, Hadith 58 (Ibn Majah 2674)

It was narrated from 'Usamah bin Sharik that the Messenger of Allah (ﷺ) said:

“No person will be punished because of another's crime.”