The context of these scriptures is that God wants His people to properly keep His annual Holy Days. God commanded the Israelites against worshipping Him by using customs and rituals practiced by the pagans. Deuteronomy 12:28-31 records God’s instructions against doing this. Verse 32 concludes, “What thing soever I command you, observe to do it: you shall not add thereto, nor diminish from it.”
Clarke’s Commentary explains, “It was a custom of the ancient heathens, when they had gathered in all their fruits, to take a kid and boil it in the milk of its dam; and then, in a magical way, to go about and besprinkle with it all their trees and fields, gardens and orchards; thinking by these means to make them fruitful, that they might bring forth more abundantly in the following year.” God commanded that these vile practices were not to be used in observing His Holy Days!
Since the Hebrew preposition could have been translated “on,” instead of “in,” these verses seem to condemn boiling and eating a kid that is not weaned. This is also a probable meaning of this command.