I've had two situations.
DTW-AMS: diverted back to DTW about 3 hours into the flight. We landed around 2:00am and sat around the deserted terminal for a couple hours until they got everything on the new plane. Anyone could have walked out, but they also would have a record of it since they would not have boarded the second flight.
LGW-DTW: I entered the departure lounge, not realizing I would not be able to kill some time picking up some duty free souviner stuff in Gatwick Village (I think that is what it was called). They would not let me back out, since "I had already left the UK". It turned out my inbound plane had been diverted to STN due to fog, so they had to bus us there. We did have to go back through passport control to get on the bus.