Good question.
I have discussed at length regarding this with endocrinologists.
There is no shortage for the source of Vitamin D - As you mentioned - UV from Sun, certain food and of course supplements. But the destination should be able to activate it. So, in my case my body is not able to activate the Vitamin D in the system properly and so is the case with most Vitamin-D deficient people.
>Vitamin D obtained from sun exposure, food, and supplements is biologically inert and must undergo two hydroxylations in the body for activation. The first occurs in the liver and converts vitamin D to 25-hydroxyvitamin D [25(OH)D], also known as calcidiol. The second occurs primarily in the kidney and forms the physiologically active 1,25-dihydroxyvitamin D [1,25(OH)2D], also known as calcitriol[1].
Further, Vitamin D is necessary for calcium absorption in the gut. Hence, the lack of Vitamin D causes bone problems among other issues.
[1]https://ods.od.nih.gov/factsheets/VitaminD-HealthProfessiona...