Four times in 320 hours, each time due to UK weather. I was looked after exceedingly well on three occasions (Cranfield, Denham and Sherburn), and the fourth time no-one knew as it was after closing hours (won't say where)!
And as regards legality, the captain is always, above all, responsible for the safety of his aircraft, passengers and self - if he doesn't look after those, THEN he is "endangering the safety" and that's illegal (and worse than any "technicality", I submit)!