Like Harry said, it sounds like a case of hammer follow-down. The hammer should be cocked as the bolt opens. My guess is that the hammer is out of spec (worn or defective). Try a different hammer to see if the same thing happens. If so, the problem would be the lower receiver itself. If the area on the bottom of the bolt carrier that cocks the hammer does not move the hammer far enough, the hammer could be getting close to the point of cocking but not quite far enough. Same thing could be caused by a worn bolt carrier, but since you tried the same lower on two different upper receivers with the same result, I will ignore that possibility.
Doesn't surprise me that it didn't fire the round on closing, though, because the firing pin is restrained by the firing pin retainer pin and pulls away from the bolt face when the bolt opens. On closing with a follow-down, the bolt closing is a gradual process and does not allow the firing pin to slam into the primer.