2007 PT Cruiser Check Engine Light and Cooling Fan...connected?

A couple months ago, my 2007 PT cruiser a/c stopped working when I was idling at stoplights – it would work fine when driving, but whenever I stopped with the engine on, the car would start shaking and the a/c would blow uncool air. We took the car to the dealer service center, and they couldn’t find the problem, but replaced some spark plugs “just in case.” Well, that didn’t fix the problem, it only got worse. So we took the car to another garage and they said the engine cooling fan needed to be replaced - so $800 later we were back on the road with a functioning a/c. Then about a week ago, the check engine light came on. I figured out the error code, and it was for the cam shaft sensor. Could these two things be related? I was driving on the highway yesterday and the car started lurching right after the check engine light came on again, that’s when I decided to stop waiting and take it in. We took the car back to the unsuccessful dealer, because we read that non-PT parts can be problematic, but the guys don’t seem to know how to fix things. Ideas???

This appears to be a separate unrelated incident.

Anyone can replace a cam position sensor – it’s merely bolt-off, bolt-on. And the part is not hard to obtain. If the dealer is stumped, go elsewhere.

I replaced the sensor in my neon, with a NAPA part,took 1/2 hour,It’s been 2 years and no problems.Not related with the A/C system, that’s on the other end of the engine