Speaking from experience in math (the epitome of the 'you can just learn everything from the book' subject), the vast majority of students who try to teach themselves the core undergrad major material on schedule will leave sizable gaps in their understanding. In theory, a book is nearly as good as a class, but in practice? No way. You might eventually manage it, but it'll take at least twice as long and you'll have to keep going back to ideas that you missed or didn't fully understand the first time. Without the interactive feedback component of a guide who can point out connections between ideas and answer questions in the moment, only the talented and diligent have any chance at matching a curated degree sequence by themselves. Saying that you learned more from the books than from the classes misses the point entirely. Books and classes are used for different purposes in teaching and this is one case where the whole is greater than the sum of its parts.
Yeah, the real value I see in school is not the teacher, but having someone to ask questions of when you're stuck.
and having someone to decide which topics are the important ones so you can focus on them
and having someone to decide the order in which to cover the topics
and having someone to show you which exercises get to the heart of the important ideas
and having someone to evaluate whether or not you really understand the material
... y'know, a teacher.
I've been in departmental meetings where we've discussed students who wanted to teach themselves an important class that they couldn't fit into their regular schedule. It rarely works, we tell them it rarely works, and sometimes they insist on doing it anyway. The proof is in the pudding though, and exam scores don't lie.