Notice there is no mention of “inerrancy” or “without error”. The key word is “useful”, a far softer and more humble word than “inerrant” or even “infallible”.
The other key word used by Paul is “God-breathed”, sometimes translated “inspired”. This word is important because it gives scripture an authority and uniqueness beyond ordinary writings and books. Still, there is nothing in the word “God-breathed” or “inspired” that implies complete freedom from error.