"Joseph's Coat Brought to Jacob", (c.1640), Giovanni Andrea de Ferrari (1598–1669).
Then Jacob tore his clothes and put on sackcloth. He mourned deeply for his son for many days. Gen. 37:34.
As far as I am concerned, God turned into good what you meant for evil. Gen. 50:20a
Just prior to the first verse, Joseph's brothers had sold him into slavery, then presented his father his coat dipped in animal's blood. Jacob formed the conclusion hoped for by his brothers, that is, that Joseph had been mauled to death by an animal.
Certainly Joseph's brothers didn't anticipate how cruel this was to their father. I'm certain they didn't want to hurt Jacob. They merely wanted to cover up their wrongdoing with a timely lie. After all, it was surely going to stir things up if they came clean and admitted their hatred of Joseph had led to their actions. The truth would hurt everyone. Instead Jacob's damaged emotions were collateral damage. Joseph was his favorite son, not just a son, but the favorite. Cruel indeed, was the collateral damage.
In light of this, it is striking to consider Joseph's conclusion in Genesis 50. Good came out of the brothers' evil, but Jacob was still lied to, hurt, and lived without the comfort of knowing his favorite son was doing right well in the long run. Would it have been possible for God to just lead Joseph by legitimate means to Egypt? Why couldn't God have just appeared to Jacob, explained that Joseph had a job to do in Egypt, but that he would have a grand reunion someday? Instead, we have this dark side of human nature show up, which God uses, but doesn't protect Jacob from.
God's sovereign plan is sometimes a head scratcher.