Sure Yusuf

12:79

قَالَ مَعَاذَ ٱللَّهِ أَن نَّأْخُذَ إِلَّا مَن وَجَدْنَا مَتَٰعَنَا عِندَهُۥٓ إِنَّآ إِذًۭا لَّظَٰلِمُونَ

Er sagte: "Allah schütze uns (davor), daß wir einen anderen nehmen als denjenigen, bei dem wir unsere Sachen gefunden haben! Wir würden sonst wahrlich zu den Ungerechten gehören."

Tafsir 12:79

Joseph asked for protection from Allah that they should wrong someone innocent with the sin of a wrongdoer. If they took someone other than the person in whose bag they found the bowl of the king, then they would be wrongdoers, because they would be punishing someone who was innocent and letting a criminal go free.