I carried on like this for a little over a week. But cruelly, no matter how present I tried to stay in increments of five or 10 minutes, by bedtime I’d find myself wide awake and worrying about whether I’d ever fall asleep. Or how I’d get my work done the next day if I pulled an involuntary all-nighter. I’d calculate the …
Anne T. Donahue
I don't want to reinforce the thought that you did meditation wrong, as my understanding is that there is no wrong or right for meditation.
Just wanted to share that I read the other day a suggestion to do mindfulness sessions in the morning or somewhere in the day instead of short before sleeping. That source (I can't recall where I read it) suggested that problems with sleep can be worsened by that. And I guess for the reasons that you state. Not sure if this is a tipp applicable for you, but the part that I cited sounded to me like you were practicing mindfulness before going to sleep.
On the other hand: personally, I have made good experience with a "body scan" exercise when I have trouble falling a sleep.