This question already has an answer here:
My son was travelling using multiple carriers from Dar-Quito via Nairobi, Amsterdam and Panama City. He had through tickets for both onward and return journeys. Ecuador issues visas on arrival for Indian citizens. A letter from the Ecuador embassy in India, downloaded from their website, was also shown to them along with all valid documentation. The airline, KLM, which was flying him from Nairobi to Panama City, did not allow him to board at Nairobi. Are they right in doing this and why? If not what needs to be done?