Very likely that the teacher lacked the math knowledge and skills to even do the work for themselves and so all they could do was accept whatever the book said as gospel. I've seen it so many times. It's very disheartening.At least you admit to the mistake.
I had a HS math teacher that was so by the book that when the book was wrong he would still keep right on going and mark anyone's papers wrong if they used the correct formulas opposed to his wrong book formulas and believe me the books we had had a lot of basic mistakes.
If I have a student that can prove that one of my solutions (or the author's solutions, though I usually work all the problems myself and catch those before the students see them) is wrong, I generally reward them with extra credit.