03 Ram 5.7 Hemi problems.

I agree with checking the coils and wires, if it runs poorly especially under load try this... Pop the hood at Nite when it's dark and spray the wires/coils down with a spray bottle full of water... If you see acrhing or sparking when it's wet, it's probably doing the same hot or under load. replace the bad stuff... It also may be a good plan to just swap a O2 sensor. I know guys have had cam and crank sensor problems, but I wouldn't expect a intermittent problem with that...

Why did you do head gaskets? Did it get really hot, if so any sensor could be suspect from heat...