The problem that I see about the selling of Joseph is that in the very beginning of chapter 39 it says the Ishmael[s] sold him to Egypt. But in the actual events it says the Tribe of Medyans in 37;36 sold him to Egypt. [Not one to the other and then to Egypt.]
But what I think is that the actual selling is attributed to the Mediyans indirectly.
But what I think is that the actual selling is attributed to the Mediyans indirectly.