I honestly could of written this post so you are definitely not alone 
I think it's normal to feel a certain level of anxiety towards the end of your pregnancy, you're near the end and have been bonding with your baby in the womb and you naturally worry about whether they are ok.
I think the unhealthy part of the anxiety is when you start to think something might go bad because of previous negative thoughts or behaviours almost as if it'd be karma playing a part and the fear escalated because of this.
I want you to know that you're not a bad person for ever thinking you just want your life back, it's a very overwhelming experience being pregnant and you've also got a lot more hormones affecting your physical and emotional well-being which make us feel things one minute that we might not the next. I really think you need to forgive yourself for those thoughts, you're human and going through a major life overhaul you've not done anything wrong x
You need to allow these emotions and thoughts to come but rationalise them that it is just your anxiety and let them wash over you. There's no point worrying over anything that hasn't happened, I know you know this but keep reminding yourself of this.
Anxiety is a daily struggle for me so I really do feel for you, it's certainly a difficult thing to talk louder than and it can be hard to break the cycle of thoughts but just know that you are stronger than this.
I can highly recommend a book called 'rewire your anxious brain' you can get it on amazon, it really helped me understand the science behind anxiety and to break some of those negative thought patterns.
I also think you should mention to your midwife how you're feeling, the more of a bond you can create with her the better as you will need her after the birth - anxiety and baby blues can create a small storm together but a strong support network and open communication with your midwife really helps (I cried for 10 days straight and barely slept with anxiety when my son was born 5 weeks ago - it's totally normal!!)
Please try and enjoy the last of your pregnancy and I hope you get some peace from the anxiety soon - you're not alone, you're not a bad person, nothing bad is happening just keep repeating that x