I hope I can overcome my social anxiety, but for the time being, is my prayer still valid but sinful?
Wikipedia says:
Social anxiety disorder (SAD), also known as social phobia, is an anxiety disorder characterized by sentiments of fear and anxiety in social situations, causing considerable distress and impaired ability to function in at least some aspects of daily life.[5]: 15 These fears can be triggered by perceived or actual scrutiny from others. Individuals with social anxiety disorder fear negative evaluations from other people.
Social anxiety is a recognized clinical disorder. Therefore, it is a medical condition.
Sura Al Bakarah: 286 says that:
لَا يُكَلِّفُ ٱللَّهُ نَفْسًا إِلَّا وُسْعَهَا ۚ لَهَا مَا كَسَبَتْ وَعَلَيْهَا مَا ٱكْتَسَبَتْ ۗ رَبَّنَا لَا تُؤَاخِذْنَآ إِن نَّسِينَآ أَوْ أَخْطَأْنَا ۚ رَبَّنَا وَلَا تَحْمِلْ عَلَيْنَآ إِصْرًۭا كَمَا حَمَلْتَهُۥ عَلَى ٱلَّذِينَ مِن قَبْلِنَا ۚ رَبَّنَا وَلَا تُحَمِّلْنَا مَا لَا طَاقَةَ لَنَا بِهِۦ ۖ وَٱعْفُ عَنَّا وَٱغْفِرْ لَنَا وَٱرْحَمْنَآ ۚ أَنتَ مَوْلَىٰنَا فَٱنصُرْنَا عَلَى ٱلْقَوْمِ ٱلْكَـٰفِرِينَ ٢٨٦
Translation
Allah does not require of any soul more than what it can afford. All good will be for its own benefit, and all evil will be to its own loss. ˹The believers pray,˺ “Our Lord! Do not punish us if we forget or make a mistake. Our Lord! Do not place a burden on us like the one you placed on those before us. Our Lord! Do not burden us with what we cannot bear. Pardon us, forgive us, and have mercy on us. You are our ˹only˺ Guardian. So grant us victory over the disbelieving people.”
Therefore, continue what you are doing right now.
However, it would be best if you focused on getting psychiatric treatment as soon as possible to eliminate this phobia.
Not treating a disease, whether physical or mental, is a bad practice.
حَدَّثَنَا حَفْصُ بْنُ عُمَرَ النَّمَرِيُّ، حَدَّثَنَا شُعْبَةُ، عَنْ زِيَادِ بْنِ عِلاَقَةَ، عَنْ أُسَامَةَ بْنِ شَرِيكٍ، قَالَ أَتَيْتُ النَّبِيَّ صلى الله عليه وسلم وَأَصْحَابُهُ كَأَنَّمَا عَلَى رُءُوسِهِمُ الطَّيْرُ فَسَلَّمْتُ ثُمَّ قَعَدْتُ فَجَاءَ الأَعْرَابُ مِنْ هَا هُنَا وَهَا هُنَا فَقَالُوا يَا رَسُولَ اللَّهِ أَنَتَدَاوَى فَقَالَ " تَدَاوَوْا فَإِنَّ اللَّهَ عَزَّ وَجَلَّ لَمْ يَضَعْ دَاءً إِلاَّ وَضَعَ لَهُ دَوَاءً غَيْرَ دَاءٍ وَاحِدٍ الْهَرَمُ " .
Translation
I came to the Prophet (ﷺ) and his Companions were sitting as if they had birds on their heads. I saluted and sat down. The desert Arabs then came from here and there. They asked: Messenger of Allah, should we make use of medical treatment? He replied: Make use of medical treatment, for Allah has not made a disease without appointing a remedy for it, with the exception of one disease, namely old age.