Check out the rear of the affected O2 sensor - I had oil leach into mine and foul the porous backing enough to kill it a couple years ago(oil pressure switch blew and leaked all over, a little while later the sensor died as the remainder of what i couldn't reach flowed down onto it). Unscrew the EGR valve from where it sits by cyl 6 and examine for gunky crap inside. Give it a light shake, it should rattle around freely.
Since you replaced the heads - did you re-use the OEM exhaust manifolds or buy replacements? Frequently the 3rd party replacements don't have the right curve machined onto the manifold-pipe interface, and every time you hit a bump or something else in the road it will cause a momentary O2 leak - after about 30-40 cumulative miles of this happening the computer will register an O2 sensor-related code that *looks* like your sensor is done for or that you have some kind of compression problem/misfire going on.
I had to replace my head gaskets during summer and got a new 4/5/6 exhaust manifold(original one's stud popped before I bought it, so the prev. owner just drilled out a new hole rather than spending $10 on some PB Blaster and a bolt remover) and I started getting weird O2 sensor codes soon afterwards that all indicate, on the surface, that I was misfiring or my O2 sensor was toast. I spent a good amount of time on smooth roads trying to figure out why my O2 sensor graph was suddenly crashing down with no success, but when I had to take a detour down a crappy, bumpy road I was able to notice the relationship since the bumps were noticeable, and start looking in the right direction for information.
If you post the actual codes encountered it will be very helpful in helping to diagnose.