COMMENTARY on 12:102
Mustafa Khattab:

Translation:
That is from the stories of the unseen which We reveal to you ˹O Prophet˺. You were not present when they ˹all˺25 made up their minds, and when they plotted ˹against Joseph˺.
Commentary:
25   This includes Joseph’s brothers, the travellers who picked him up from the well and sold him into slavery, and the Chief Minister’s wife and other women in the city.

 

A. Yusuf Ali:

Translation:
Such is one of the stories of what happened unseen, 1784 which We reveal by inspiration unto you; nor were you 1785 (present) with them then when they concerted their plans together in the process of weaving their plots.
Commentary:

1784  The story is finished. But is it a story? It is rather a recital of forces and motives, thoughts and feelings, complications and results, ordinarily not seen by men. However much they concert their plans and unite their forces, whatever dark plots they back with all their resources—the plan of Allah works irresistibly, and sweeps away all their machinations. The good win through in the end, but not always as they planned; the evil are foiled, and often their very plots help the good. What did the brothers desire in trying to get rid of Joseph, and what actually happened? How the Courtier's wife, encouraged by the corrupt women of her acquaintance, tried and failed to seduce Joseph and how Allah listened to his prayer and saved him from her vile designs? How wrong was it of the cupbearer to forget Joseph, and yet how his very forgetfulness kept Joseph safe and undisturbed in prison until the day came when he should tackle the great problems of King's kingdom? With every character in the story there are problems, and the whole is a beautifully balanced picture of the working of Allah's Providence in man's chequered destiny. (R).

1785  The Prophet was no actor in those scenes; yet by inspiration he was able to expound them in the Divine Light, as they had never been expounded before, whether in the Pentateuch or by any Seer before him. And allegorically they figured his own story—how his own brethren sought to betray and kill him, how by Allah's Providence he was not only saved but he won through. (R).

 

Muhammad Asad:

Translation:
THIS ACCOUNT of something that was beyond the reach of thy perception We [now] reveal unto thee, [O Prophet:] for thou wert not with Joseph's brothers 103 when they resolved upon what they were going to do and wove their schemes [against him].
Commentary:
103  Lit., "with them".