Hello,
I don't know your age but that would be informative as you are asking about confounding issues. The two confounders are that with increasing age miscarriage rates increase (most commonly due to an increase in chromosomal abnormalities secondary to aging oocytes), and with increasing age the menstrual cycle can begin to vary in length by 7 days or more. So it is not necessarily the change in cycle length (or a change in the luteal phase) that is the cause of a miscarriage, but rather the fact egg quality continues to decline with age.
Medication will not get your ovulation on track, but you may benefit from assisted reproduction with or without a donor egg if ovarian reserve (that is to say egg age) is a major concern.
Best regards,
Dr. Downing