I think trying to present the topic in an interesting and engaging way is worthwhile.
But thinking you can get 100% students interested in it is probably unrealistic. I don't think you can get all the students interested in any given topic, so why think of this as a failure? Getting a decent number of students interested is good enough. Getting all of them? Unrealistic.
I don't even think this is a failure of the students. Coding isn't universally interesting. It's ok to find it boring, through no fault of either the teacher or the students.