Something similar once happened to me. I was transiting Beijing and didn't have a valid Chinese visa (for reference, I'm a US citizen). I had an overnight layover and discovered upon my arrival in Beijing that the transit area was closed for the night. I had planned to sleep in the terminal to avoid the expense of buying a visa. I approached an immigration officer, explained my situation, and asked what I should do. He immediately stamped a one-day visa into my passport and admitted me into China.
As it happened, it snowed that night and my flight out the next morning was delayed. It was scheduled to depart at about 8:30 am, and they let us board at about 10. We then spent the rest of the day on the tarmac, supposedly waiting for de-icing. As tempers flared, they eventually canceled the flight at midnight. Upon disembarking, I again had no valid visa for China (my one-day visa having expired, and myself having checked out of the country anyway). But, they ran all the passengers through immigration the wrong way, and the officials didn't even examine anyone's passports. So, I ended up with an additional day in China until boarding the flight they re-booked me on.
All in all, while this trip had many hassles, immigration issues weren't among them. Chinese immigration never gave me any problems.