Having issues on the books riddle/puzzle too, the book cover doesn't match with the bookshelf genre when putting them in "the right" place.
Yellow book (Planet) matches with Blue bookshelf (Astrology) both being space themed.
Blue book (Knife & Fork) matches with Red bookshelf (Cooking) both being food related.
Can enter & exit out of the door fine without getting the door being different with the Blue & Yellow book on the Blue & Red bookshelves (one, or the other, or both). Unless this is a bug and you shouldn't be able to exit until you get all of them right.
You'd think the Red book (Flowers) would fit into the Yellow bookshelf (Gardening) as they're both horticulture related. Unfortunately this isn't the case and the door changes to the never ending death sequence.
Pink door (Candy) and the Green bookshelf (Fairy) don't really align, thought Candy at first went with cooking as they're similar. Think this book is the anomaly that you don't put in place as it's not thematically correct for any of the book shelves asides the Red bookshelf.
Thank you & hope there's another angle to this bookshelf puzzle that the community isn't able to look at to make this puzzle possible to solve. :)