I had this happen during my second trimester too and it was quite unsettling, but my gynae said it's quite common in pregnancy due to hormonal changes and the physical discomfort of sleeping. The jerking usually settles down once you find a comfortable sleeping position, so I'd suggest trying a pregnancy pillow if you haven't already, and maybe some relaxation breathing before bed. That said, since you're already dealing with insomnia, it might be good to bring this up with your PD or gynae a bit earlier if it's really affecting your sleep quality, just to rule out anything and get some proper advice. Hang in there, this phase will pass.