> What is a reasonable hypothesis then?

The logical conclusion is that vitamin D, as we measure it, is proxying for another factor that we haven't yet detected. This X-factor is heavily influenced by sun exposure, but at most weakly influenced by vitamin D supplementation in its current form.

Analogously imagine that we had no concept of the health benefits of exercise. We detected that people with gym memberships were much healthier than those without. So, we try giving a bunch of people a free gym membership. Yet few of the recipients end up using it to do any exercise. In this case the supplement group would show nowhere near the health gains of the baseline gym members. The key issue is that gym membership is only proxying for the underlying X-factor of physical activity.

Michael Pollan makes a great critique of a type of thinking called "nutrionism". Basically that the determinants of health can be broken down into their isolated sub-components. "You need X amount of protein, Y amount of this vitamin, and Z amount of this mineral." The problem is that unless our understanding of biology is perfect, there's almost certainly going to be flaws in the decomposition. When we try to replicate a healthy diet with a synthetic mixture of vitamins and macronutrients, we still fall well short of natural food. A very famous example of this is when people on total parenteral nutrition kept dying, because the original formulations lacked chromium. Humans only need a microscopic amount, yet die without it. Nobody realized this because almost all natural foods have trace amounts that satisfy the requirement.

As for vitamin D specifically, I think there's three pretty good candidates for what the missing X-factor is. In order from least to most controversial:

1) Our current understanding of the sub-types of Vitamin D is not complete. It wasn't too long ago that we began to learn that Vitamin D3 is much more essential than Vitamin D2. It's possible that there are sub-types of Vitamin D3 that are made in the correct proportion in the skin, but aren't represented in supplements.

2) There are other micronutrients, not yet discovered, that are synthesized in the skin. This goes back to the chromium example. Sun-exposed people may have high levels of Vitamin D + Vitamin X. Yet we can only measure the former, so we over-attribute the importance of Vitamin D.

3) Sun exposure induces the same physiological adaptations as physical exercise. Consider what we know about the mechanism of how exercise induces its health benefits. Micro-traumas to the muscle fibers and metabolic stress leads to an acute stress response. That peak leads to a down regulation of the HPA axis with accompanying metabolic benefits. The muscles recover, with an adaptation against the stress.

Is it not possible that something similar happens when we sunbathe? Without a doubt UV exposure induces micro-traumas in the skin cells, that looks very similar to what's found in the muscle cells. There's also emerging evidence that sun exposure triggers the HPA stress response[1], in the same way that exercise does.

If this is the case, then trying to replicate the benefits of sun exposure with supplements is a fool's errand. It's the sun exposure itself, specifically the sun damage, that is directly responsible for the health benefits.

[1]https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4398592/