It has only been in the last few years that doctors have been willing to recommend D3. Previously they only prescribed D2 in sub 1k amounts for bone strength. D2 is synthetic and contains only a small part of vitamin D. D3 is plant derived and much closer to the natural sunshine. I think doctors got onto that bus after noting that many people had discovered the benefits of D3 which was being obtained from the store without a scrip and doctors were being left out of it. People who live near the equator don’t need it.
You are right. For many years doctors were giving vitamin D tp prevent rickets (poor bone growth). I was being given cod liver oil 80 years ago as I got colds and ear infections often. Only recently have doctors learned that much higher doses are good for immune health. Endocrinologists (experts in hormones) recommend 50% higher amount than the US health agencies do as the minimum recommended daily requirement. Even those levels are not considered Optimum by them. I am too lazy to look up the actual content of the measures used, but the govt. says 20, endochronoligists say 30, Kaiser Permanent gives optimum as 50 to 80. Late 2021 I was 66, 2022 was below 20, 2023 was 130. Dec. I have my annual physical, hope I am back between 50 and 80. Europe uses a different content description, which multiplies our figures by 2.5 times, thus our 20 is their 50, etc.