I have been doing some research and have come up with connections between vitamin d, gallbladder, melatonin and calcium. Some of the connections between calcium and the gallbladder are: Limy bile, porcelain gallbladder, UV exposure and incidence of gallstones and mixed-type gallstones. It is my belief that the gallbladder plays a very important role in the body to do with calcium metabolism/buffering/regulation.
Try a magnesium only supplement and start at low doses. It should take several days if it's going to work for you.