That is a misrepresentation of the following text:
Jer 31:32 Not according to the covenant that I made with their fathers in the day that I took them by the hand to bring them out of the land of Egypt; which my covenant they brake, although I was an husband unto them, saith the LORD:
Notice, it says nothing about "law". It refers to "Not according to the covenant that I made with their fathers ..."
That "covenant" is found in Exodus 19, and is not the Ten Commandments:
Exo 19:3 And Moses went up unto God, and the LORD called unto him out of the mountain, saying, Thus shalt thou say to the house of Jacob, and tell the children of Israel;
Exo 19:4 Ye have seen what I did unto the Egyptians, and how I bare you on eagles' wings, and brought you unto myself.
Exo 19:5 Now therefore, if ye will obey my voice indeed, and keep my covenant, then ye shall be a peculiar treasure unto me above all people: for all the earth is mine:
Exo 19:6 And ye shall be unto me a kingdom of priests, and an holy nation. These are the words which thou shalt speak unto the children of Israel.
Exo 19:7 And Moses came and called for the elders of the people, and laid before their faces all these words which the LORD commanded him.
Exo 19:8 And all the people answered together, and said, All that the LORD hath spoken we will do. And Moses returned the words of the people unto the LORD.
There are two covenants mentioned here.
[1] God's "my covenant", aka "His covenant" = the eternal covenant, the Ten Commandments (that already existed, even with Abraham, etc)
[2] The ('old') covenant God made with "their fathers", in which He offered, "If ... then ...", and they said, "All that the LORD hath spoken we will do. ..." (which 'covenant' at that time, then came into existence), then turn to Hebrews 8:
Heb 8:6 But now hath he obtained a more excellent ministry, by how much also he is the mediator of a better covenant, which was established upon better promises.
Heb 8:7 For if that first covenant had been faultless, then should no place have been sought for the second.
Heb 8:8 For finding fault with them, he saith, Behold, the days come, saith the Lord, when I will make a new covenant with the house of Israel and with the house of Judah:
Heb 8:9 Not according to the covenant that I made with their fathers in the day when I took them by the hand to lead them out of the land of Egypt; because they continued not in my covenant, and I regarded them not, saith the Lord.
The 'old' covenant was their agreement to obey God in all things.
The Law of God, the Ten Commandments, is at the heart of both covenants (see 2 Cor 3), but the means by which it is obeyed is differing. in the 'old' they promised and failed. Their promises of their fathers was faulty (in fact Jeremiah speaks of the teeth set on edge). God's Law of Ten Commandments are perfect promises, never to be rescinded.
Psa_89:34 My covenant will I not break, nor alter the thing that is gone out of my lips.
The Two Great Commandments are smack in heart of the Torah OT, Deuteronomy 6:5 and Leviticus 19:17-18, in context of God's Law, the Ten Commandments, see Deut 5, and Lev. 19 "sin". I thought you told us it wasn't the same? What gives?