The Pentax 645 I bought appears to have a problem
Basically, it appears that in P mode there is a 50% chance that the camera selects the smallest f/stop (f/22 or smaller) during exposure, even though the camera shows a much larger f/stop in the viewfinder. So, at least 50% of the pictures are badly underexposed (near black). If the camera does not select f/22 all by itself, then the shots are perfectly exposed.
The lens does not seem to be a problem, as all lenses I tried behave the same. So it must be on the body side. Any ideas about the source of the problem?