Mark 10:18 and Luke 18:19 – And Jesus said to him, “Why do you call Me good? No one is good except God alone.”
From Gill’s Exposition of the Entire Bible:
What Christ here says of God, the Jews say of the law of Moses, whose praise they can never enough extol; “there is nothing good but the law.” The law is good indeed; but the Author of it must be allowed to be infinitely more so.
Christ did not say the comment was wrong (John 10:30), but shifted the focus where it belonged – on YHWH. He had a habit of doing that:
Luke 11:27-28 – As [Jesus] said these things, a woman in the crowd raised her voice and said to Him, “Blessed is the womb that bore You, and the breasts at which You nursed!”
But He said, “Blessed rather are those who hear the word of God and keep it!”