There is nothing wrong with praying in darkness.
۩ Narrated Abu Salama. Aisha the wife of the Prophet (ﷺ) said, "I used to sleep in front o Allah's Messenger (ﷺ) and my legs were opposite his Qibla and in prostration he pushed my legs and I withdrew then and when he stood, I stretched them.' `Aisha added, "In those days the houses were without lights."
Sahih al Bukhari, Book of Prayers ﴾8﴿, hadith - 382.
۩ Shaykh Abd al-Kareem al-Khudayr said:
“If the conditions of prayer are fulfilled and the essential parts or pillars of the prayer are completed, then the prayer is valid. Light is not an essential condition of prayer or an obligatory part of the prayer. But if the darkness is a cause of fear which disturbs a person to the point that he cannot have the necessary presence of mind and humility (khushoo’) in prayer, then it is makrooh for him to pray in the dark.”