Mankind is fallible, see Romans 3:23; 1 Timothy 6:10; Galatians 3:22, etc.
God's Word, the Bible [KJB] is infallible and does not contradict itself, even Yea, and Amen, as He is the True Witness: 2 Corinthians 1:20; Revelation 3:14; Titus 1:2; John 10:35; Psalms 12:6-7; Acts 17:11; Hebrews 4:12; 2 Samuel 22:31; Psalms 33:4; Isaiah 28:10,13; 1 Peter 1:25; James 2:8 "according to the scripture" etc.
The Ten Commandments [Exodus 20:1-17] are the standard against which all must be tested, Proverbs 30:5,6; Deuteronomy 18:20; Numbers 15:31, 22:18; 1 John 3:4, etc.
Thus "the Law" and the "testimony", which are the scripture, is the final authority in all matters of faith and practice, see [and please notice the order of operation]:
Isaiah 8:20 KJB - To the law and to the testimony: if they speak not according to this word, [it is] because [there is] no light in them.
See Matthew 4:4, Luke 4:4; Deuteronomy 8:3
2 Timothy 3:1-17, is also clear, that the scriptures are that which allows man to be "perfect", "throughly furnished" [sanctuary language], unto all good works.
As for the 66 books, this too, is in the sanctuary, 6 loaves on the left, 6 loaves on the right, 66 [bread and the word, linked], also see the Candlestick itself, count the flowers, knops, etc, and it comes to 66, for the Word is a Lamp unto my feet. The OT, is also 39, which is the standard of judgment, 40-1 [forty save 1].