David appears to contradict himself in the same psalm. First he says to God, “I have not strayed from Your precepts” (Ps 119:110). But later he admitted, “I have gone astray like a lost sheep” (Ps 119:176). However, it would seem that both cannot be true.
Psalms 119:110
NKJV - 110 The wicked have laid a snare for me, Yet I have not strayed from Your precepts.
For follow-up discussion and general commentary on the topic. Comments are sorted chronologically.