It's not entirely AI's fault though, probably.
I'd imagine the Terminal Duty Manager would not allow 300+ passengers to disembark the aircraft to be kept airside like a transit lounge. At Manchester at least, if an aircraft diverts in and road transportation is required to get the passengers to their final destination, the passengers are not allowed to disembark the aircraft until the coaches are sat outside arrivals waiting for the passengers.
As bad as it sounds, it's a lot easier to keep 300 pissed off passengers onboard rather than swanning about the terminal ranting and raving