I've pasted below an excerpt from a paper which described how low vitamin D levels can cause insomnia. It also discussed why low vitamin D can lead to B12 deficiency. During my many, many hours of online research I've never read anything about this, has anyone else?
Why vitamin D deficiency can lead to B12 deficiency:
Vitamin D helps make a protein in your saliva called haptocorrin. While you chew your food the haptocorrin binds B12 and accompanies it through the stomach. In the stomach vitamin D helps make a second protein, intrinsic factor, that binds to the B12 and accompanies it to a special absorption area in the small intestine. These two proteins help guarantee that we get every single B12 that comes along in our food.