The Egyptian question was debated at least twice here in the last few months, so you might want to look up the thread. Depending on which side and what evidence you accept, there was no desertion. That is also quite evident in some of the memoirs of the expedition.
As for Russia, Napoleon left the army after the last big fight at the Berezina, something he refused to consider before getting out or Russia. He was urged, because of the Malet plot and his personal safety as head of state, by his senior subordinates to get back to Paris once the army was out of danger from the Russians, whose pursuit slackened after the major defeat they suffered at the Berezina.
Napoleon left Murat in command, who soon quit and went home. Eugene was convinced to take over by Berthier, these two saving the frosted remnants, Eugene later building up an effective army to defend the eastern marches of the Empire until Napoleon joined him in April/May 1813 with a new army.