My apologies Rivers56, I started to write up that learn procedure and got side-tracked. Then being my usual self completely forgot to get back to you.
Looking at two different manuals, one said the learn procedure was required, the other didn't mention it at all. Odd. But yeah, I think you could be onto it as it does say that the learn procedure should only be done with that one code and no others. That code being for learn procedure not done. So points to some issue with the pedal or wiring for me. Though I'm guessing you'll need to do it once the new pedal is in, so glad you found it anyway. Seriously doubt it's the TB, you'd have to be really unlucky to have a new one throw the same code as the one you just replaced, and throw the APP code not a TPS code.
The other thing I was thinking (and I haven't looked into this yet) is a problem with the wiring from the pedal sensor. Maybe a short in that from some water, or a loose connector. Sort of what you were thinking may have damaged the APP (pedal sensor). I haven't checked to see where the wires go from that to see if there's a connector to check (or to test the continuity on the wires). I'll pull out the wiring diagrams today to see if I can work it out. IF it goes straight to the ECM, that could also be an issue maybe (the connector). Not sure though if that would throw a voltage error or a communication error (if there even is a comms error code for that). Just thought of that as a possibility as I was getting a comms error with my EBCM that I managed to fix simply by cleaning the connector with some electrical contact cleaner.
Out of curiosity, what are you using to check the codes and clear them? Are you using a cheap OBD2 dongle or a Tech2/workshop scan tool? I just ask as my OBD2 dongle off ebay will only show "P" (powertrain) codes and not "B","C" or "U" codes. Where my Tech2 picks up them all. Wondering if there could be a "U" code you aren't seeing as that relates to the CANBUS system and communications between modules. This is all brainstorming for me, so I'd have to check up on those as well. Oh and which engine is in your car, in case I need to know that to tell which wiring diagram to check?
Oh and big thumbs up for updating the thread still for others. Hate it when threads just die and no solution is given if found (or what people have tried to solve the issue, so others have ideas if they have a similar solution).