The book of Judges tells us the sad story of Jephthah (Yiftach), who vowed he would sacrifice anything coming out of his house, and it turned out to be his daughter. [Judges 11]
Not only does God not stop Jephthah at the last minute, as He did for Abraham about to sacrifice his son Isaac, but the Midrash says that God was displeased only because Jephthah allowed for the possibility that an unsuitable sacrifice might be made!
The Holy One, blessed be He, said to [Jephthah]: “Then if a camel or an ass or a dog had come forth from your house, you would have offered it up [to Me] for a burnt-offering?” What did the Lord do? He… prepared his daughter for him. [Genesis R. 60:3]
Does it mean God made sure it was Jephthah's daughter who would come out first? If so, why? What do ALL the Sources tell us about God's involvement in this entire matter?