In some countries melatonin is not sold as a hormone but as a supplement, and thus are not as well regulated. Because of this it is not uncommon for the doses to be too high leading to the effect lasting well into the light phase of the day, which can have complications for Type II diabetes, for examples, and Melatonin participates in the modulation of insulin sensitivity.
You misunderstood M.R. Rosatti, he did no wrote, as you referenced: "You said that taking a large amount of melatonin can cause diabetes". He wrote: "...can have complications for Type II diabetes". That makes a big difference.
Generelly from the internet: "Less common melatonin side effects might include short-lasting feelings of depression, mild tremor, mild anxiety, abdominal cramps, irritability, reduced alertness, confusion or disorientation. Because melatonin can cause daytime drowsiness, don't drive or use machinery within five hours of taking the supplement."
One more addition to the topic. Melatonin is not primarily a sleeping pill. Its effect is limited to synchronizing the day-sleep rhythm. It tells your body that it is now dark outside (provided this effect is not suppressed by artificial light).
There is no harm as such. As they have commented, melatonin has a key role in circadian biological clock synchronisation of the sleep-wake cycle.
However, if a person takes melatonin while exposed to artificial light, especially blue light (such as from electronic device screens or bright lights), the efficacy may be reduced. How? So, blue light inhibits the natural production of melatonin in the brain (mainly in the pineal gland) and can interfere with the message that the supplementation is trying to convey to the body. Thus, its recommended avoid this type of light in the hours before sleep to maximise the effects of melatonin and fix our sleep-wake cycle.
Dear Ruohan, I apologize for the delay in answering your question, but I was busy with other important things. As Saúl mentioned (thanks for answering the question instead of me), there is no harm for melatonin use through the light. To further understand the role of melatonin in the wake-sleep cycle you should get familiar with some physiology of the circadian rhythm. During the day, the eyes perceive daylight and transmit this information to the “internal clock”. For the body, this means vigilance and mental/physical activity. When darkness falls and the eyes perceive no light, the “inner clock” activates the pineal gland in the epithalamus at the back wall of the third ventricle of the brain. The pineal gland then increasingly releases the hormone melatonin, signaling that it is now dark outside. This information results in rest for the body, which manifests itself in sleep. The hormone secretion peaks around midnight (idealised) and gradually decreases until the morning hours, preparing the body for the next day's activity. If someone wakes up during the night and their eyes are exposed to bright light (e.g. going to the toilet) this interrupts the release of melatonin, which in turn can make it more difficult to fall asleep again. See also the attached figure.