As above, if in a commercial aircraft, the flag in placed on the coffin as soon as it is unloaded.
update - I'm on the phone with my sis - a veteran flight attendant. She thinks this frieght thing is not accurate. She promised to look into it and get back to me.