Me time to sleep?

Have any of you mommas or soon to be mommas experienced this? I'm in my third trimester and the insomnia is back. My docs have given me meds for it, but they dont work. I've come to the realization that, having me time, or the wonderful O 😏, puts me to sleep within 20 minutes and knocks me out cold. Does anyone know why this is happening or why it works and doc meds dont? TIA