In my understanding, and some airline agents understanding, the key point is to distinguish Europe/Middle East Continent, Europe zone, and Middle East zone.
Some airline agents and I agree to this point.
In page 2
The continent of Europe/Middle East consists of 2 zones:
* Europe (including Algeria, Morocco, Russia west of the Urals & Tunisia)
* Middle East(including Egypt, Libya and Sudan)
There are four possible paths for Europe/Middle East - Africa - Europe/Middle East (Ignoring other restriction)
Europe zone - Africa - Europe zone (ex. LHR-JNB-LHR, LHR-NBO-LHR)
Europe zone - Africa - Middle East zone (LHR-JNB-DOH)
Middle East zone - Africa - Europe zone (DOH-JNB-LHR)
Middle East zone - Africa - Middle East zone (DOH-JNB-DOH)
When you to/from Europe (zone) in both direction (Europe zone -Africa - Europe zone), the itinerary may not include South Africa/Mauritius.
Therefore, LHR-JNB-LHR is invalid, and LHR-NBO-LHR is valid.
After that, you have to satisfy
One of the visits to Europe/Middle East must be a transfer without stopover between Africa and the previous/next continent.
So,
Bottom line. I want to go to CPT then to BKK (without flying JNB-HKG).
IMHO,
CAI-xLHR-CPT-xDOH-BKK-...-xMAD-...-DOH is valid routing.
However, I realized your original routing includes 6 segments in Europe/Middle East continents.
(CAI-LHR,xMAD-KEF-xTXL-DME-xDOH-CAI)