I was just reading this question Can I travel within a week still? I didn't realize my passport expired over a month ago
and began wondering what would happen if your passport expired while you were out of your home country?
I would assume that customs would realize that your passport would be expired within the time period of your stay (i.e., you want to stay for a month in X country, but your passport expires in 15 days), and refuse you entry to your destination, but what if customs didn't notice, and you were allowed entry?
I also saw this question What happens if you lose your passport at an airport / during transit?
Where one of the answers mentioned that you would be sent back to your home country (if passport was lost away from home), or possibly be able to work with your country's embassy in order to work something out.
So I am curious what would happen if your passport does expire during a trip? Is it similar to if you lost your passport, or is it something else entirely?
NOTE: This question is purely out of curiosity.