You're ignoring the fact that gravity is constant, so it contributes nothing to power production. If anything, it would tend to make a flat engine wear more on the lower half of the cylinder, but in practice there's so much going on with the piston that its not much of an issue.
Horizontal, vertical, upside-down, inline, vee, or rotary engines - no one design is more or less powerful than another. As fowler said, packaging determines engine shape.
The power differences come from other factores like bore/stroke, valve placement, valve size / shape, combustion chamber size / design, port shape /size, cam profile, exhaust system, etc, etc, etc.
Changing the orientation of an engine usually requires some serious mods, best to keep it mounted as it was designed.