It definitely sounds like you have a programming issue. I do not know about the code flashing first time for me as well. I learn something almost everyday here. Here are the instructions from ford on the troubleshooting and programming methods:
Key Programming Using Two Programmed Keys
This procedure only works if two or more programmed ignition keys are available and it is desired to program additional key(s). If two keys are not available, refer to KEY PROGRAMMING USING DIAGNOSTIC EQUIPMENT.
PID SPARE_KY must be enabled for this procedure to operate. If this PID is not enabled, follow the security access procedure. Refer to ANTI-THEFT SECURITY ACCESS and select SPARE KEY PROGRAMMING SWITCH: ENABLED.
If the programming procedure is successful, the new key(s) will start the vehicle and the THEFT indicator will illuminate for approximately three seconds.
If the programming procedure is not successful, the new key(s) will not start the vehicle and the THEFT indicator will flash. If the programming procedure was not successful, repeat the key programming procedure from Step 1. If the failure repeats, refer to DIAGNOSIS AND TESTING to review the DTCs and carry out the pinpoint tests as necessary.
A maximum of eight ignition keys can be programmed to a passive anti-theft system (PATS) equipped vehicle. If more are needed, refer to KEY PROGRAMMING SWITCH STATE CONTROL.
If the steps are not carried out as described, the programming procedure will end.
Ignition keys must have correct mechanical key cut for the vehicle and must be a PATS encoded key.
If the vehicle is in unlimited key mode, this spare programming procedure still functions. Any two keys that can start the vehicle may be used to program in an additional unlimited key.
Insert the first programmed ignition key into the ignition and turn the ignition from OFF to ON (maintain the ignition in ON for one second).
Turn the ignition OFF and remove the first key from the ignition lock cylinder.
Within 10 seconds of turning the ignition OFF, insert the second programmed ignition key into the ignition and turn the ignition from OFF to ON (maintain the ignition in ON for one second).
Turn the ignition OFF and remove the second key from the ignition lock cylinder.
Within 20 seconds of turning the ignition to OFF, insert the unprogrammed ignition key (new key) into the ignition and turn the ignition from OFF to START (attempt to start the vehicle).
If it is desired to program additional key(s), repeat the key programming procedure from the beginning.
Key Programming Using Diagnostic Equipment
Turn the ignition from OFF to ON.
Using the diagnostic tool, follow the SECURITY ACCESS to obtain security access. Refer to ANTI-THEFT SECURITY ACCESS.
From the diagnostic tool menu, select IGNITION KEY CODE ERASE.
Do not select any additional commands from this menu.
Turn the ignition OFF and disconnect the diagnostic tool.
Insert the first encoded key into the ignition and turn the ignition ON for one second.
Insert the second encoded key into the ignition and turn the ignition ON for one second.
Remove the second encoded key from the ignition.
The vehicle should now start with both ignition keys.
Have you tried a hard reboot of the system by holding the negative battery cable to the positive post discharging the capacitors and then reconnect and unlock the drives door.
Check out the diagrams (below).
Please let us know what you find. We are interested to see what it is.
Image (Click to make bigger)
Monday, January 18th, 2021 AT 6:03 PM