Assalamualaikum wr wb,
There were disturbances in my mind while reading a story about the khalwa of Syeh Nazim with Syeh Abdulloh ad Dagestan. The story explained that Syeh Nazim just came out to see the sun and when for praying in jamaah. From that story, Syeh Abdulloh never saw the sun when in khalwa and just looked at the candles alone. Did Syeh Abdulloh not prayers together (jamaah)?
Another story, Syeh Abdulloh was in khalwa another time for 5 years. Based on the story, the snake wrapped him for 40 days, how about his prayers in jamaah?
Sorry if my language is not good.
As for the Madina khalwa, the Pen of the Law is lifted from those who are in a state of unconsciousness or non-cognizance.
As for the 5-year khalwa, it was in the wilderness, like Shaykh Abdul Qadir Jilani for 12 years.
Hajj Gibril Haddad