Lead in measures cause repeats to double play the melody line.
You can delete this. I had a couple of repeats further down that appear to cause this weird looping.
When a lead in measure is present, multiple endings play simultaneously along with the melody line, when the ending is encountered. Further, the first ending is skipped and the second ending played twice...
See the following score for an example.