The Iranians did the same thing, brought some moderates into the government early on, then bumped them off down the road.
Egypt is run by the various successors to Nasserites, and all of them were Islamicists as well as being socialists. Nasser’s profile, fame, and popularity kept rising right up until he started the Six Day War and 75,000 Egyptian soldiers died, most of them of thirst as they fled across the Sinai. The Egyptian people (and Nasser himself) weren’t aware of how bad the beating was until the survivors started swimming across the Suez Canal to get back home. Nasser’s health cracked, and he basically never recovered.
Sadat was next, and skillfully guided Egypt’s transition away from Soviet-style socialism into a system of patronage more in tune with Muzzie populations everywhere, but particularly in the Arab world. His fellow Nasserites didn’t like that, so Sadat took the risk of letting the jihadists out of prison in order to balance the political situation. And he continued his path of building a peaceful Egypt by concluding the treaty with Israel. Then the jihadists shot him.
Mubarak’s reign was longer than Nasser’s and Sadat’s, and he built the system of patronage and Sadat’s peace treaty into a model. There are more Egyptians now than there have ever been, and economically the country is in the best shape it’s ever been in. Living conditions for most people have been improving, and even the poorest in Egypt are able to live okay and earn an income. He failed to rein in the Islamofascists to the needed extent, earning himself a reputation for brutality and human rights violations never seen since our troops made Iraqi thugs wear underwear on their heads. Egyptian police had managed to keep order in a country with open calls for jihad and shariah “law”, and they only had to arrest fascists and give them beatings.
This new joker may not be in power (or alive) very long. His only shot is to try to pry the hands of the old guard from ownership of most industry in Egypt. He’ll probably make his first overseas trip to Nicaragua and/or Venezuela, rather than Iran, although I’m sure Iran will be on his itinerary during his first or second year. He has to calm things down, and the first step is this announcement about his diversity policy. :’)