“But you wouldn’t be allowed back to the gates without screening without being screened again”
So, they spend the night in the terminal (heaven forbid the airline put them all up in hotel). 9 hrs in the terminal is better than 9 hrs on the plane
Maybe that's the real reason they kept the passengers in the plane.
They didn't want to put them up in a hotel.