Dark retreat is a traditional practice in Tibetan Buddhism and Bön[0]. The usual guidance is that a dark retreat should be done only when the meditator has attained stability in the Natural State. Not many Westerners are in this zone, but seem able to benefit nonetheless [1],[2]. There are mental health risks[3], as in any other meditation practice. One claim is that sustained darkness stimulates the production of endogenous DMT.[4]
[0] https://en.wikipedia.org/wiki/Dark_retreat
[1] 3-week Darkness Retreat in Guatemala. https://imcb.dharmaseed.org/teacher/424/talk/51886/
[2] Dawning of Clear Light: A Western Approach to Tibetan Dark Retreat Meditation (2003) https://www.amazon.com/Dawning-Clear-Light-Approach-Meditati...
[3] https://www.mindful.org/willoughby-britton-the-messy-truth-a...
[4] https://www.universal-tao.com/dark_room/enlightenment.html