It would have to be a problem internal to the trip computer. If the car is able to start then there should be no worries keeping time settings etc. The fact that it’s only when you turn the car off sort of rules out bad wiring too. I’d say there’s an internal battery, or perhaps even some volatile storage device that is kaput. Perhaps you could take it apart and see if there is obviously a battery that you could try replacing. Otherwise these would be hard to find from wreckers etc. Buy a new one from Ford?