When God was sending 7 years of plenty, followed by 7 years of famine, the Patriarch on the Earth who held the keys of the gospel of Abraham was Jacob, also named Israel.
As is proper, to warn the world, God came to Jacob in a dream and told him to prophesy that the world could be saved by listening to His mouthpiece.
Wait? Jacob didn't get the dream?
Oh, yeah, well Joseph was the heir apparent, the favorite son, obedient and righteous. This must have been like Lehi and his son Nephi, where the Lord revealed things to Nephi, even though Lehi was actually the leader.
Not Joseph either? Huh.
Well, this is totally outside the proper line of authority. You say Pharaoh had a dream of warning? That didn't come through the right channel, so we know for absolute surety that Pharaoh is being deceived. The revelation through a dream is not coming from the Lord. Pharaoh isn't allowed to receive such things.
Oh, except that is exactly the way the Lord orchestrated this whole thing, isn't it? A heathen Pharaoh had a dream, Joseph was saved from prison to interpret the dream, Egypt was saved, Joseph and his brothers were reunited, and Jacob was saved from the famine.
The Lord works how the Lord works.