It happened to me once in Saudi Arabia - due to a delay at immigration; my visa was marked as invalid because midnight had passed.
They didn't stamp anything on my passport. I was held in a jail at the airport - was not allowed to enter the country.
My passport was with the immigration officials; who then escorted me to the next departing flight to Kuwait and my passport was handed to the flight crew. On arrival in Kuwait, I was handed my passport and I entered the country as if nothing had happened.
There are two land crossings between Saudi Arabia and Kuwait; and at each of them there is a "no man's land"; which is a land buffer between the two countries.
Anything in this land is considered in a neutral zone. There are plenty of vehicles and remnants of the Gulf War there (old tanks, etc.)
Here is a picture that I took during one of my road trips to Saudi Arabia that shows the fence around the no-man zone:
The green sign in Arabic is pointing cargo vehicles to the right and passenger vehicles straight forward; and underneath that "immigration and customs"
If you are denied entry into either of the countries, you have to cross over this land border; assuming you can enter either of the bordering countries.
If you are inadmissible to either of the countries, then you are held in the detention center and then subject to deportation.
You're fortunate to have been admitted to Kuwait. Please consider
adding a scan of your refusal stamps. Also, did you encounter
screwballs whilst in detention? What were the conditions like?
Unfortunately there were no refusal stamps; because the delay was from the immigration's fault (they had a computer glitch).
So it was as if I never entered Saudi Arabia. No entry stamp, no exit stamp. Just an exit and entry stamp from Kuwait. The reason I was admitted into Kuwait is because I had arrived from Kuwait (I have permanent residency there).
The detention conditions were poor by Western standards, but okay for Saudi standards.
There was a cot with some bedding; the room had no light and there were lots of bugs running around; it was a temporary cell till the concerned were either shifted out to the immigration cell or boarded an exit flight.
For the majority of the time I was there alone; and since I was caught in a bureaucratic loop hole (my flight was well on time, and had they not had issues with their systems, my visa was valid) and wasn't trying to enter illegally, I spent most of my time outside the detention area sitting on the waiting chairs at the immigration arrival hall.
During shift changes, I had to go back into the cell, until someone came up and check on me and then they were apologetic and just let me come out again.
I did have one another person from Nepal who was escorted to the cell around midnight the first night I was there. The person didn't speak Arabic or English; but spoke Hindi which I can also speak.
I asked one of the officers what was his situation since they were unable to explain to him why he was in detention.
They explained to me that they suspected he had falsified his date of birth on the passport and appeared underage. The person was coming in on a labor visa.
I explained to him the situation and personally; he did look underage - probably a victim of visa traders.
He didn't have any contact numbers except for one of the person that was supposed to pick him up. I offered my cell phone to make the call, but the number was disconnected.
The officials told me that they would put him back on the first flight to Nepal.
Considering what was waiting for him (labor camps and virtual slavery at the hands of his sponsors) he didn't know it yet, but the Saudi immigration was doing him a favor and sending him back.
I tried to explain it to him but (like most such workers) he was just concerned as he had to take a loan to pay for the visa and ticket.
Honestly - the immigration officials were very understanding - it helped that I understood and spoke some Arabic and I was not panicking/yelling. To me it was one of those situations where I would chalk it up to a great story to tell.
My parents were very upset as they were not told what it going on. So my mother complained to the immigration staff what is going on, etc. and so (as is usually the case in Saudi - women are given priority in matters); they escorted me to an area where they brought my mom in so she could see that I was okay and everything.