The trusting servant
ויהי רעב בארץ וירד אברם מצרימה לגור שם כי-כבד הרעב בארץ
There was a famine in the land, and Avram descended to Egypt to settle there, for the famine was very severe in the land
Right after Avraham was told to go to the land of Israel, a place where he would prosper, a major famine hit the country. Rashi tells us that it was that land alone which was struck by famine. Our Sages tell us that Hashem tested Avraham ten times. This was one of the tests. Will Avraham question Hashem? He was just told that he would prosper in the land of Israel, and soon after arriving, he is forced to leave. Isn’t this a bit strange? Avraham triumphed, and had full faith in Hashem. He went to Egypt without any complaints. Soon afterwards, the famine ended, and he was able to return.
This is all Rashi’s interpretation of what happened. However, the Ramban seemingly has a polar opposite view. This couldn’t have been one of Avraham’s ten tests, as all of those he passed with flying colors. Here, the Ramban shockingly tells us that Avraham failed, and even sinned a great sin. He should have had more faith in Hashem. He was told that he would prosper, and immediately upon entering the land, left for Egypt for safe haven. Had he really trusted in G-d’s promise, he would have stayed.
However, perhaps we can say that there’s no disagreement. The Ramban has a famous opinion when it comes to bitachon, having trust in Hashem. If a person reaches complete perfection, they will be able to rely totally on Hashem for all of their needs. They won’t have to deal with the physical world at all. If they become ill with some disease, they won’t need to seek the medical care of doctors, for Hashem is the Doctor of all doctors. When there was prophecy, people would seek out from the prophet what Hashem wants from them. If they followed the proper spiritual remedy, their physical illness would resolve itself.
This is the ideal, yet obviously most people don’t attain these spiritual heights. As a result, we all need to take care of ourselves through the physical world. We can’t rely on Hashem for everything, and we need to do our proper worldly endeavor. If a person becomes ill, G-d forbid, they indeed need to seek proper medical advice. When the Ramban says that Avraham sinned, he meant in terms of the ideal. Avraham hadn’t yet perfected himself, so for him this whole ordeal was a test, which he indeed passed. Yet, had he reached a state of perfection, leaving Egypt would have been considered a sin on his part. A true, perfect servant of Hashem would have relied on Hashem’s protection and oversight. This was an earlier part of Avraham’s spiritual journey, and he had a long way to go before he reached perfection.
 Based on Emes L’Yaakov to Genesis 12:10
 Genesis loc. cit.
 Ad. loc.
 Avos 5:3; Pirkei D’Rabbi Eliezer Chapter 26
 Pirkei D’Rabbi Eliezer loc. cit., brought by Rashi, Rambam, Rabbeinu Yona, Meiri, Rashbatz, and Bartenura, to Avos loc. cit.
 Ad. loc.
 Indeed, this is how Radal ad. loc. § 22 explains the opinion of the Ramban, that he disagrees with Rashi and Pirkei D’Rabbi Eliezer. Radal brings a source for the Ramban from Zohar I parshas Lech Lecha p. 83a, that according to Rabbi Yehudah, Avraham left without permission. He was punished with having his descendants become slaves in Egypt. However, Rabbi Shimon in the Zohar concurs with Pirkei D’Rabbi Eliezer
 Ramban to Leviticus 26:11
 Exodus 15:26
 Rav Yaakov justifies his claim that the Ramban agrees to Rashi, since the Ramban himself quotes Bereishis Rabbah 40:6, which says that Hashem told Avraham to leave Egypt