When flying into the UK I've shown my (non-EU) passport to immigration control and got my regular entry stamp. Upon exiting the UK, the airline employee didn't want to see my passport and instead asked for my Czech residence permit. I've tried to get them to enter my passport details instead but the airline employee refused and they've assured me it won't cause any problems.
But this got me wondering — couldn't this lead to a situation where my residence permit isn't matched to my passport and the UK immigration authority assumes I've overstayed? Since no exit stamp is provided when leaving the UK, how can I prove I haven't actually overstayed?