I see this all the time. Student delivers a great piece of work, but it simply doesn't answer the question being asked, so the teacher/lecturer simply has no option but to fail it. It sucks for the teacher that they have to do it, but they have to do it.