As you work on wiring. Keep in mind, the wire housing block(s) with corrosion inside. Corrosion inside means, either the seal failed or it was not fully seat making a good seal. The block on LH (driver side) has a very special locking mechanism. Which indicates Toyota engineers were very concerned with that block prehas with moisture. For some reason in that one, more than the others.
I would think your issue, began at a time one or more of these were disconnected and then not fully seated when reconnected. Perhaps making a good enough contact/continuity, no faults at the time. Then over time, moisture made its way into housing block.
There are only a few services, where one or more would have been disconnected. One bing (but not needed), is starter R&R. Others are engine or transmission R&R. Even could have been diagnostics work in the pasted. Knowing a vehicles service history and carfax history, has value in diagnostic.
I'll note: I did see one 01LX, that had history of electrical gremlins. It's the one I pictured AHC wire harness block corrosion. It's history showed various electronic issues, starting while still under warranty period. We don't know why, these wire housing blocks seals were failing. Was it a freak factory issues. Or could vehicle had been in deep water, possible a flood. Without any carfax or service history to indicate anything unusual, perhaps! But typically these blocks hold-up very well, unless disturbed.
Point being. We must try to find and understand why a component fails, so we can correct the "why" as we fix the issue.
Most all wire housing blocks are available from Toyota/Lexus. So are the pigtails (wire leads).
I'd disconnect wire block from sides of transmission. Testing contine from AT end to CPU and replays. Target corrosion block first, which may save time. You may want to check the wire from transfer case also.
Here's where it gets tricky. Just because it has continuity, doesn't mean the resistance is not higher than it should be. Resistance can be to high reduce current read by CPU, due to a connection with oxidation/corrosion or even some of the strands within wire sheathing being damaged. Which we should see some outside signs of (chew marks, burn, rub, crush, etc.) yet still show continuity. Knowing the resistance (OHMs), may or may not be in FSM. Some will be in diagnostic section. Where it will have test for OHM at specific temperature range.
Note: Aircraft technician, use new wire harnesses to compare resistance to those within the aircraft. My Toyota parts guy is great guy. I can buy for testing & return, as long as working and saleable.
Note the while plastic lock on LH wire housing block
View attachment 3760917
IIRC you had CDL DTC, which CDL SW as at end of below wire harness. Possible clue!
View attachment 3760918
Engine side of AT wire, main wire harness
View attachment 3760940
AT side of AT wire harness
View attachment 3760921
I splice wires with water tight seal & soldier like this: