Did you replace the timing chain and sprockets by any chance?? If so,having them installed incorrectly could cause both issues.
It would have to be very loose,but is it possible the timing chain has jumped??
The valves might not be closing completely.
If it jumped to a advanced position, that could have possibly caused an overheat condition, blowing the gaskets.
What triggered you to replace both head gaskets?? Symptoms??
Did you run a compression test before tearing into the engine or only after the gaskets were replaced?? If compression was down before disassembly and the timing chain has not jumped, the rings might be bad.If you run the test again and pour a couple tspoons of oil into the plug hole before the test, an increase in compression indicates ring issues.
Do you have stock rocker arms or roller rockers?? If roller,incorrect valve lash setting could cause it.
If stock rockers,get the #1 piston to tdc on the compression stroke (the 0° balancer mark should be aligned with the timing pointer & a swoosh of air should come from the spark plug hole,when the #1 piston is at tdc on the compression stroke) then hand tighten the intake rocker bolt while spinning the pushrod until you feel resistance on the pushrod
then torque the bolt to 24ftlbs.Do the same to the exhaust rocker.
Now rotate the crank clockwise 90° and do the same procedure, following the firing order (13726548) ,to the next set of valves (#3) in the firing order until you finish them all.
An easy way Ive found to identify every 90° of crank rotation is drawing lines or big dots on the balancer,to represent 90°,180°,270° & 360°.Locate the 0° mark and draw a vertical line from there to the bottom,then draw a horizontal line.It will look like the picture below.With these lines drawn,once you finish the valves at #1,rotate the crank CW (stopping at the next line) and do cylinder #3.Finish the remaining cylinders in the firing order.