Demanding the departure of embassy staff, and the closure of embassies, makes sense to me. Their presence legitimizes the Coup.
However, I do not understand the rationale for threatening any and all foreign nationals residing in, or visiting Egypt. That seems indiscriminate and reactionary to me and I don’t think it is fair to assume they are necessarily in favor of the Coup or working against the freedom of the population. They might also, of course, be Muslims.
Of course, such a threat will potentially damage multinationals and investment, and could help to cancel the Summit; but I think the negative repercussions will be great.
وَلاَ يَجْرِمَنَّكُمْ شَنَآنُ قَوْمٍ عَلَى أَلاَّ تَعْدِلُواْ
Multinationals and foreign investments are valid targets for disruption, but just being foreign does not automatically make you a component of the imperial system