Peace
The only reason I say that imprisonment is not God's law in this case, was because it was issued by the governor's wife first. Please note, you said yourself earlier, "Since we know the punishment for adultery is not Prison"...
1232
She said, "This is the one you blamed me for falling in love with. I did indeed try to seduce him, and he refused. Unless he does what I command him to do, he will surely go to prison, and will be debased."
1233
He said, "My Lord, the prison is better than giving in to them. Unless You divert their scheming from me, I may desire them and behave like the ignorant ones."
1235
Later, they saw to it, despite the clear proofs, that they should imprison him for awhile.
I dont think we can ignore just because the governor's wife said it first. She is not issuing an order. From 1235, it is clear that he is sentenced to jail.
Also on the same lines, for the punishment for theft.
1275
They said, "The punishment, if it is found in his bag, is that the thief belongs to you. We thus punish the guilty."
1276
He then started by inspecting their containers, before getting to his brother's container, and he extracted it out of his brother's container. We thus perfected the scheme for Joseph; he could not have kept his brother if he applied the king's law. But that was the will of GOD. We exalt whomever we choose to higher ranks. Above every knowledgeable one, there is one who is even more knowledgeable.
If you look at the verse 1275, it is said by Joseph's brothers when they are asked for what was a just punishment if they were found guilty. And from 1276,we know it is not King's law. So it was Joseph's scheme to get his brother. Joseph did not issue the command.
And the punishment per 1275 is Slavery as i mentioned in my previous post.
Please correct me if i am wrong.
MA, I am learning a lot. Thanks !
Salaam