I really don't understand the overall logic of slot_execute_orders() -> find_last_unit_pos() call, the only place where latter is called. Former has iterated units_list.unit_list to the point where the unit in question is, and then it asks latter to do same iteration to the same spot, and to access data there.
Well, find_last_unit_pos() might find unit's *transport* before unit itself, but 1) why would that be necessary as the unit itself in the same tile (within the transport) anyway, 2) inconsistency in that if the transport is in the list *after* the unit (not sure if that's possible), it's not used.
mr_menu::find_last_unit_pos() assigns local 'punit' as the last line before returning.