If your mental health issues are classed as a disability, I believe your university has a legal responsibility, under the Equality Act, to provide you with reasonable adjustments. I have been at a few universities and, in my experience, requests for reasonable adjustments don't go through lecturers. Most universities have a health and wellbeing department and the requests usually go through them. If you haven't already, try and find some information on your universities' website about reasonable adjustments/extenuating circumstances and hopefully that will direct you to the appropriate department.
I should also reiterate ivybasil's comment about perfection. When I was at university I was obsessed with everything being perfect which didn't help my wellbeing at all. I learned to accept (begrudgingly) that perfection is an unrealistic expectation and that making one or two mistakes isn't the end of the world. Don't worry about your work being perfect, just have a good go at it. If you pass, fantastic. If you don't, you won't be alone, and should be able to resit the assessment.