Crimes committed on board I know a similar question was asked here before, but there is a difference:

Let's say person X is on a flight from Pakistan to Canada on PIA (national carrier of Pakistan). The aircraft lands at, say, Toronto Pearson Airport. 

From what I gather after reading the Tokyo Convention, the aircraft is no longer in flight once the airplane doors have been opened for disembarkation.

If an offence occurred on the airplane once the doors have been opened for disembarkation, which country is responsible for prosecution? The country where the aircraft is registered or the country where the plane has landed?
Once the doors have been opened, it's a pretty clear case: the crime happens on some sovereign soil, and that country is responsible. They are also most likely to get custody of the criminal, which as described in the other answer is a large part of who prosecutes.