Was Jephthah’s sacrifice of his daughter to YHWH in Judges 11:29-40 legitimate? God never required human sacrifices, and always told the Israelites to substitute their firstborn males that were dedicated to him with animals (Exodus 13:11-16, Numbers 3:40-51). The firstborn of all clean animals got burnt on the altar, for unclean animals they could be killed outside the camp (unclean animals don’t belong on the altar) or substituted with a clean animal. Humans however were never to be killed and to be substituted with a clean animal, just like how Abraham substituted Isaac with a ram. Substitution for humans was always God’s intent and this points to Jesus being substituted for our sins.
Girls’ were never to be dedicated in that way, this rule was only for the firstborn males. Also if you pay attention Jephthah said in Judges 11:30 ” I will give to the Lord whatever comes out of my house to meet me when I return in triumph. I will sacrifice it as a burnt offering.” His intent was probably money and livestock, not his daughter, but he made a reckless oath. Now he could have asked God if he could substitute, but the answer could have been no because his oath said “whatever comes out of my house to meet me”. It is also possible that God would have let him substitute her for some other living thing in his household based on the principle of firstborn dedication. We don’t know because Jephthah didn’t ask, he just assumed that the firstborn dedication was a special law and his oath was made in his own recklessness so he had to do it. This story if anything is a cautionary tale about making reckless oaths. This is why Jesus said in Matthew 5:33-37, not to sweat oaths anymore and to let you yes be yes and your no by no. Based on the idea that God always asked for humans to be substituted, and the fact that God used the penal substitution atonement system to save humanity through Jesus Christ, I believe Jephthah could have asked for substitution and God would have shown him mercy. The moral of the story is don’t make reckless oaths, but if you do ask God for mercy and he will forgive you (1 John 9:1, Hebrews 4:16).