Airline employees routinely turn people away at the departure airport due to visa/passport paperwork not being in order. Timatic is the usual system that most airlines subscribe to for this kind of thing. Airlines are highly incented to avoid letting a passenger board who won't be admitted, because they're on the hook for returning that passenger. But an airline employee in at the departure airport is never going to be able to be a perfect proxy for an immigration officer in every country they fly to, and immigration officers generally have wide latitude in who they accept/reject. It is extremely possible that all your paperwork is in order but the immigration control officer rejects you for other reasons.