Rashi, Megilla 25a s.v. ha'omer says if you translate the psuk of "mizaracha lo sitein le'haavir lamolech" as "don't have relations with a non-Jewish woman, becuase that child will serve avodah zarah" you change the meaning of the pasuk, and give kares to a ba al hakusis etc. We see Rashi holds haba al hakusis does not get kareis, not like the Rambam. However, Maharsha ibid. brings the Aruch who says the reverse of Rashi: the pshat of that pasuk is that haba al hakusis does get kareis, and if you say the pasuk deals with bringing your child as a human sacrifice, that is perverting the Torah. Furthermore, Targum Yonasan on Vayikra 18:21 explains the pasuk like the Aruch. The Aruch and Targum Yonasan, then, argue on Rashi and agree with Rambam. And, if you look at the context of the psukim, the Aruch & Targum Yonasan make more sense because all the psukim before it and after it discuss sexual sins. According to their explanation, this pasuk also deals with a sexual sin. However, according to Rashi, this pasuk deals with avodah zarah, and seems out of place.
This updates the following post: