Properly speaking, Joseph should have gone out free from his dungeon on the same day as the butler. He had been there ten years by that time, and had made amends for the slander he had uttered against his ten brethren. However, he remained in prison two years longer. "Blessed is the man that trusteth in the Lord, and whose hope is the Lord," but Joseph had put his confidence in flesh and blood.
He had prayed the chief butler to have him in remembrance when it should be well with him, and make mention of him unto Pharaoh, and the butler forgot his promise, and therefore Joseph had to stay in prison two years more than the years originally allotted to him there. The butler had not forgotten him intentionally, but it was ordained of God that his memory should fail him. When he would say to himself, If thus and so happens, I will remember the case of Joseph, the conditions he had imagined were sure to be reversed, or if he made a knot as a reminder, an angel came and undid the knot, and Joseph did not enter his mind.