Any chance you found the problem?
I have the EXACT same issue basically. Mine is a 2018 Defender HD10 XT. My problem originally started as the check engine light staying on and as long as I just jumped in and drove it, it wouldn't go into limp mode until I let it go back to an idle, at which point I would have to shut it down and let it completely reboot, then fire up and go again with the same results. I would get codes P0301 and P1172.
I also have drained and cleaned fuel tank, replaced fuel pump, replaced injectors, MAP sensor, O2 Sensor(twice), plugs, plug wires, coils, and filters. I pulled apart the throttle body and cleaned it and tested it, adjusted the valves, made sure the battery was fully charged and passed a load test. Compression is great, and I also threw a new belt on it while I was that deep into it.
Now I am able to start it up, drive it and the check engine light will go out until I let it go back down to an idle, then when I begin to accelerate again, the check engine light will come on and almost instantly go to limp mode. Codes I'm getting at P0301 and P0302.
Just looking for the next place to look. Was debating on either harness or ECU but hate to make that jump as I've already sunk almost a grand into parts for this problem alone.