Another interpretation of "See, I have made you a god to Pharaoh" (Exodus 7:1): What is the meaning of "to Pharaoh"? Just because I have called you a god, your spirit should not become haughty within you. You are a god only over Pharaoh. And likewise it says, "And God spoke to Moses and said to him: I am the LORD" (Exodus 6:2). What is the meaning of "I am the LORD"? Rather, He said to him: Even though I have made you a god, I am the LORD. You are a god only over Pharaoh, as it is said, "See, I have made you a god to Pharaoh" (Exodus 7:1).
Why Moses Was a God Only to Pharaoh and Not Above
Midrash Tanchuma Buber, Vaera 9:1
ד"א ראה נתתיך אלהים לפרעה. מהו לפרעה, לא בשביל שקראתי אותך אלוה תהא רוחך גסה עליך, אין אתה אלוה אלא על פרעה, וכן הוא אומר וידבר אלהים אל משה ויאמר אליו אני ה' (שמות ו ב), מהו אני ה', אלא אמר לו אע"פ שעשיתי אותך אלוה אני ה', אין אתה אלוה אלא על פרעה, שנאמר ראה נתתיך אלהים לפרעה.