Yes - outside the West it can be very sticky even after an emergency
When the BA flight lost all 4 south of Java way back and eventually made it into Jakarta Halim at some ungodly hour of the morning all the pax were taken off and lodged in local hotels until they could sort out onward flights - except one. I think he was a Pole and at that time they required a special Indonesian visa as he was a "communist".
They wouldn't let him out of the airport. They made him sleep in the departure lounge before sticking him on the first flight to S'pore in the morning.
Both the BA Captain and the British Ambassador offered their personal guarantees that he'd be delivered intact if he could stay in the hotel or the residence but "rules are rules"...... in fact he was lucky not to be arrested .................