@Shinyshoe73 I'm sorry to hear that you're going through this. I had something similar three years ago, although for me it was Sertraline that triggered it. I became obsessed with sleep, with the predictable outcome of stopping sleeping! I clearly remember one night when I was panicking and I ended up taking Valium, which didn't work - I spent the few hours about to drop off then startling awake with a falling sensation in my stomach. It's amazing how that sleep-panicked state can keep you awake through anything! It was a miserable night of many and I had to go to work with no sleep. I was despairing So, you're not the only person who has experienced this. Eventually what got me out of it was adding a small amount (7.5 mg) of Mirtazapine to my Sertraline, I also think things settled down with the medication generally. It sounds like you're doing something similar with Amytriptline, but stick with it, I had the odd crappy night with Mirtazapine, it doesn't mean that your insomnia is 'incurable' or anything like that! But once you're stuck in the sleep anxiety loop it can feel really hopeless, I know.
Anyway, three years on I am quite a good sleeper, but sometimes the anxiety hits (basically if I don't fall asleep immediately!). If that happens, I find it helpful to - with my eyes closed - try and stay awake as long as possible, have a think about something broad-ranging, like the world, or a detailed life story, basically something that you won't come to the end of. Relax into it, enjoy the storytelling as it distracts you from waiting for sleep. Or, if you get anxious thoughts, tell yourself you'll entertain them for a few minutes - I think panicking about panic and trying to suppress it makes it worse, so if you're heart is racing, let it race. Think of the absolute worst that will happen if you don't sleep; you'll feel like crap, but you'll manage (I imagine). You could also wear a sleep mask, and tell yourself that if nothing else, you will be lying in the dark for 8 hours, which is a rest. Basically, take the pressure of yourself to sleep, as that never works! You can't make yourself sleep.
I also find the Sleepo app really good (not to be confused with Sleepio, which I think costs a fortune), it has soothing sounds and will play for 8 hours if you want it to. Listening to gentle sounds distracts me from the swirling thoughts.
This might sound strange, but is your duvet too hot? I recently realised that my problems starting when we got a goose feather one....
Finally - from your post I get the impression there's other anxiety in your life at the moment. I know that my general anxiety can make itself felt in sleep. Perhaps for you it's about something else? I found the Headspace anxiety pack really useful for this - it helps you see anxiety for what it is.
Hang in there OP, it will get better!