Yes. You could replace it with an LHR-<somewhere allowed e.g. IST>-LHR but the 2 stopover rule is the fundamental limitation. If you want to stop in LHR after coming from Cairo and again before going to LAX then the LHR-IST-LHR would have to be a turnround in IST.
The alternative would be to use those two segments within Asia.
The stopovers outside Europe (in your case) are irrelevant - there is only a restriction for your continent of origin.