17a-OHP deficiency is linked to lower cortisol production, and from what I understand is necessary for the adrenal gland to do its job.
Have you gotten your cholesterol, sodium or potassium tested by an endocrinologist by any chance? If sodium is low and/or potassium is high this would imply the adrenal gland failure.
Typically low cortisol is seen in patients who suffer Addisons disease. Despite you suffering insomnia, Addisons disease usually displays symptoms of feeling tired and faint. Also, one tell tale sign of low cortisol is frequent dehydration due to rapid decrease in blood pressure. Is this something that’s familiar?
The contrast of Addisons would be Cushing’s syndrome, where patients produce too much cortisol. People typically contract exogenous Cushing’s as a result of using steroids to treat eczema or asthma for example. For the sake of this conversation I would rule out endogenously caused Cushing’s since the method of contraction is extremely rare in this context. Interestingly, the symptoms of Cushing’s (high cortisol) resemble those of PFS pretty damn closely: Moon face, muscle wastage targeted in shoulders and thighs, obesity in the central part of the body, thinning of skin, excess body hair, erectile dysfunction, osteoporosis, depression, insomnia which leads to chronic fatigue.
Sorry for my rant, the reason this is relevant is because 17aOHP is required by the adrenal gland to produce cortisol, and synthesis of androgens, estrogens, and neurosteroids. This is purely speculative, but I would probably rule out low OHP as being the the cause of your insomnia.