Cant Figure Out P0340 Issue

03 3.8 88k miles
Had issues with car wanting to die after starting, stalling when come to stops, and issues with it bucking randomly. Scanned and got P0340 code.
Replaced alternator which fixed it for a bit then same issue. Replaced sensor. Fixed it for a bit then same issue. Sent back alternator exchanged for new one. Battery kept dying when I went to replace alternator so I replaced alternator and fixed the P0340 for a bit then I went and got a new battery and it was once again fixed for a bit and today had same issues.
Popped OE sensor back in and again fixed it and I took my other car to work but I'm assuming the issue will come back tomorrow or the next day.

Is there anything else I can do? Is there a special procedure for replacing the sensor? I just popped it off and put the new one in. Idle and charging voltage is nominal
 
Well, you are not really "fixing" the problem if the code keeps coming back.
You have pretty much already ruled out the alternator, battery and the sensor.
Since it is "circuit" code, then you need to test that circuit wiring for good continuity and for being able to carry a load.
You will need a vehicle/engine specific wiring diagram and test the circuit end to end for high resistance, open, short to ground or short to power.
First test for 2 ohm or less resistance on the circuit end to end.
If that tests good, then test for the circuit to carry a load, IE, will it light a test light if the circuit has power.
Both of those tests will either confirm or deny a short to power or a short to ground.
If you have high resistance, fix the circuit.
If it will not carry a load, fix the circuit.
The easiest fix at that point it to overlay the harness (run a new wire end to end).
And one other thing to test for, terminal tension.
As in, does the wire connector pins have a tight fit to the sensor pins?
Loose terminal tension can lead to frustrating diagnostics and cause intermittent problems.
 
Got it. I have a multimeter, ill have to get to testing. As far as I can tell for the connector, it seems to be tight. There isn't a whole lot of wiggle to it when I install it.

Just to be clear tho, is there any special procedure for replacing the sensor? I don't have to do anything special to align it to the synchronizer below?