Upvote:3
It is possible that this can work, but you would need to depend on the checkin/gate agents of both airlines to be rather more flexible than they have to, in order to let you board the flights towards C.
Of course if one of your countries dislikes the other enough that it considers it a crime (treason?) to have a passport from the other one, then you can't even show the other passport at check-in without potentially getting into trouble, and then you have no way to convince that airline that the boarding pass you have is yours. So let's assume that's not the case.
The problem is then still that if the airline away from C refuses to let you board (for any reason, including a cancelled/overbooked flight, or simply because your inbound flight gets delayed en route), then the airline that brought you to C would be on the hook with C's authorities for bringing you there without having the right documentation to enter.
If you meet very sympathetic and service-minded agents at all places, it's not impossible that they'll look past this. But it is by no means certain -- so unless you're extremely risk-tolerant you would be advised to secure appropriate visas for country C with one (or both, as appropriate) of the passports.