I had an F-150 that would intermittently not come out of Park. I called the service adviser at the Ford dealer to I suck-up and asked about it. He told me that 95% of the time it is in the brake interlock circuit and to check the fuse and ensure the brake lights work. The lights worked intermittently. I looked under the dash at the brake light switch and couldn't see it, but wiggling the wires with the brake pedal pressed flashed the brake lights. Turned-out to be one of the wires going into the connector assembly was stressed fractured, but the insulation kept it in place, so teh problem was intermittent. I replaced the metal connector connecting it to a good part of the wire and all was well.
The real problem? The switch is mounted in an assembly that is connected to the brake pedal. The wiring harness is attached under the dash and the switch assembly moves causing the wire to fatigue. Dumb, dumb, dumb. My other cars have the switch connected to the firewall, so that the there is no movement in the wiring.