Did a quick search for references that ‘commandments’ pointed to something apart from the TEN.
(Psalms 119:96 I have seen a limit to all perfection, but Your commandment is without limit.)
Malachi 2:1,4 ‘commandment’ points to sacrifices
Leviticus 27:34 ‘commandment’ points to tithes
Numbers 36:13 ‘commandment’ points to Zelophehad’s daughters’ inheritance
Job 23:12 ‘commandment’ points to the words of God
Nehemiah 13:5 ‘commandment’ points to offerings
2 John 1:5 ‘commandment’ points to loving one another
And this is interesting,
1 Kings 14:8 – God said David kept the commandments, but we know David broke them.
Jesus points right to the Ten in His teachings…..and says when one obey mans rules above God’s commandments, one worships in vain.
Matthew 15:3 He answered and said to them,
“Why do you also transgress the commandment of God because of your tradition? 4
For God commanded, saying, ‘Honor your father and your mother’; and, ‘He who curses father or mother, let him be put to death.’ 5 But you say, ‘Whoever says to his father or mother, “Whatever profit you might have received from me
is a gift
to God”— 6 then he need not honor his father or mother.’
Thus you have made the commandment of God of no effect by your tradition. 7 Hypocrites! Well did Isaiah prophesy about you, saying:
8 ‘These people draw near to Me with their mouth,
And honor Me with
their lips,
But their heart is far from Me.
9
And in vain they worship Me,
Teaching as doctrines the commandments of men.’ ”
And again teaching from His Fathers commandments
Matthew 19:17 So He said to him, “Why do you call Me good? No one
is good but One,
that is, God.
But if you want to enter into life, keep the commandments.”
18 He said to Him,
“Which ones?”
Jesus said, “
‘You shall not murder,’ ‘You shall not commit adultery,’ ‘You shall not steal,’ ‘You shall not bear false witness,’ 19 ‘Honor your father and your mother,’ and,‘You shall love your neighbor as yourself.’ ”
And again Jesus teaching and warning us to not break the least of the commandments nor teach others to break them quoting directly from the Ten.
Matthew 5:19 Whoever therefore breaks one of the least of these commandments, and teaches men so, shall be called least in the kingdom of heaven; but whoever does and teaches
them, he shall be called great in the kingdom of heaven. 20 For I say to you, that unless your righteousness exceeds
the righteousness of the scribes and Pharisees, you will by no means enter the kingdom of heaven. 21 “You have heard that it was said to those of old, ‘You shall not murder, and whoever murders will be in danger of the judgment.’ 22 But I say to you that whoever is angry with his brother without a cause shall be in danger of the judgment. And whoever says to his brother, ‘Raca!’ shall be in danger of the council. But whoever says, ‘You fool!’ shall be in danger of hell fire. 23 Therefore if you bring your gift to the altar, and there remember that your brother has something against you, 24 leave your gift there before the altar, and go your way. First be reconciled to your brother, and then come and offer your gift. 25 Agree with your adversary quickly,while you are on the way with him, lest your adversary deliver you to the judge, the judge hand you over to the officer, and you be thrown into prison. 26 Assuredly, I say to you, you will by no means get out of there till you have paid the last penny. 27 “You have heard that it was said to those of old, ‘You shall not commit adultery.’ 28 But I say to you that whoever looks at a woman to lust for her has already committed adultery with her in his heart. 29 If your right eye causes you to sin, pluck it out and cast
it from you; for it is more profitable for you that one of your members perish, than for your whole body to be cast into hell.30 And if your right hand causes you to sin, cut it off and cast
it from you; for it is more profitable for you that one of your members perish, than for your whole body to be cast into hell.
The problem with a quick search instead of prayerfully and carefully studying the scripture is you tend to lose a lot of context. There are more than Ten Commandments, but the Ten Commandments are included in the commandments of God according to God. Exodus 34:28, Exodus 20:18, Exodus 20 and Jesus Matthew 15:3-9, Matthew 19:17-19, John 14:15, Matthew 5:19-30. They are different than all other commandments because God not only spoke the Ten, He also personally wrote these commandments with His own finger Exodus 31:18. Only the Ten were placed inside the ark of the Covenant in the Most Holy of God’s Temple which is revealed in heaven Revelation 11:19 under His mercy seat and what we will be judged on. James 2:10-12. Which is why Paul points directly to the Ten to point out sin. Romans 7:7
In regards to David, he did sin, but repented so his sins were blotted out and he did keep the commandments of God, just like we see with a lot of the hero’s in the scriptures many sinned, but were able to gain victor over sin and when we get to the faith chapters in Hebrews, their sins are not mentioned, because they all repented with a sincere heart, turned from their sin and walked with God in obedience to Him. This is encouraging for us because we too can overcome our sin through Jesus and He gives us a new heart that keeps His commandments through love and faith.