Upvote:2
Regarding your second scenario. This is almost never an issue. Just come over to migration office at an airport and explain the situation. They usually have an authority to extend your visa for 24-72 hours in case of such an emergencies.
Upvote:2
First first case, worst case, they will not allow you to enter, so you should wait few hours in airport before to pass the passport control area.
And this depends a lot of the country you are entering. If control is computer based, and without allowing exception, you have bad luck and you should wait.