Well it seems a few protagonists here are incorrect on the definition of when an aircraft is "in flight" regarding the legal powers of the Aircraft Commander wrt upholding the discipline and conduct of passengers, crew and property on board an aircraft under their command.
From the Tokyo Convention which is the legal document determining the powers of Aircraft Commander and when they apply.
Article 5 paragraph 2 refers
In flight is from when all external doors are closed after embarkation to an external door being opened for disembarkation.
In the United case with Dr Dao, the Aircraft Commander wasn't at all responsible for the discipline and or safety of the aircraft, persons or property which would jeopardise good order and discipline whilst at the gate with doors open as you would expect was the case.
Montreal Convention also refers.