On my 4th day of CrossFit I learned two things... I CAN continue, although slow, when my lungs are burning hotter than thermite AND CrossFit is prone to giving me insomnia (I suspect the cortisol) as I was exhausted and couldn't fall asleep last night, finally managing only a few hours of poor sleep. So that being said, being a bio-hacker and all, pulling out my two favorite cortisol modulating tools... Inositol and Phosphatidylserine.
Now, I've seen a lot of people recommend ZMA or just magnesium (which might help some) but I suspect the real issue here is cortisol. I've used both Inositol and PS in the past very effectively for dealing with excess cortisol that was causing insomnia and am sure I'll have great results here too, I prefer Doctor's Best Best Phosphatidyl Serine 100, 120-Count and Jarrow Formulas Inositol Powder, 227g or (if you want capsules/pills) Jarrow Formulas Inositol, 750 mg, 100 Vegetarian capsules.
Inositol has been used in multiple studies in help treating PTSD at several grams a day, personally I can attest to it's functionality here. After my hypokalemic event I was experiencing PTSD rather bad, 3-5g of inositol a day for a couple of months helped tremendously as I'd start to panic if I got relaxed or just randomly while sitting which would spike cortisol, the elevated cortisol would then make me more prone to getting antsy/panicking so it was a nasty feedback loop. I found some PTSD studies and accounts of combat veterans using as much as 15g of inositol a day with great success so gave it a try. Worked great!
PS has been shown in multiple studies (as well as ancedotal reports by many many athletes) to lower cortisol levels as well. 3-5g of inositol a day and 300mg of PS and I completely defeated the PTSD in 2-ish months and then as long as I didn't start thinking about the event while laying in bed I had zero issues going forward and have not had anything remotely resembling an episode in at least a year and a half!
This wouldn't just be limited to insomnia caused by CrossFit but any training, let's face it... a lot of us can't train in the morning and find ourselves training after work, I no longer CrossFit but I do Olympic lift at a CrossFit affiliate and on particularly demanding days (like doing a widow maker set) I'll find myself taking some inositol and PS first thing when I get home and then again just before bed so I'm not in bed awake for hours and hours before I fall asleep. Both were also invaluable when dealing with my PTSD from the hypokalemic episode.
If you find you are training hard and having trouble sleeping, or training hard and have your kcals dialed in and are operating at a deficit but having trouble losing weight I'd definitely tinker with cortisol modulation. Your mileage may vary but it's something I'd definitely try for a month or two and see if it helps you too!