There is some speculation that the Mopar camshaft sensors are coming from the same Chinese sources as many of the aftermarket sensors.
I was getting that P0340 code, and only that code, but my LJ had no problem starting, cold or not. When cold, if I kept it under about 2500 RPM until it reached operating temp, it would then run fine. If I tried to exceed that RPM too soon, it would go into limp mode. Shutting it off and restarting the LJ and going through the drill again would work. Several start/stop cycles of this would clear the code.
I saw some inmates on here claimed to have had luck with the Echlin sensor from NAPA. I got one, and it was crap. Instant limp mode, cold or hot. I reinstalled and struggled along with the original Mopar sensor for a month or so, then tried another Echlin. It runs great now, cold warm, hot, whatever, and has for a couple months now.
It just seems to be hit or miss with aftermarket sensors. Sucks to keep throwing good money after bad, but this what I went through.