I have mostly written PB's in a quite narrow niche, but that said, I truly believe that it's best to write what calls you, including taking on projects in entirely new genres if that's what you get up in the morning wanting to write. There are definitely upsides to working with a particular kind of PB; if you develop an audience for your specific kind of book, if you're (excuse the expression; I really hate it) branded, then librarians, bloggers, parents and reviewers do have a sense of what they're getting into when your new book comes out. Also, while I don't want to damn my earlier books, I think that if you keep working on a particular variety of PB, it's possible to get better and better at the work as you go along, in a way that is reflected in reviews, awards, and sales.
A downside to staying wed to a niche is that it's possible to develop an inertia, so that even shifting within the niche can be a bit unsettling. (I shifted from Eastern European Jewish folklore to an Afghani folktale, coming out next year, which might sound like a tiny change, but it was challenging both in terms of the research involved and in developing an ability to discern if the retelling was true and did the original justice.)
As an aside, the enthusiasm for a particular project more than others could mean a ton of things other than that you should forget about the other manuscripts or areas that interest you. Maybe there was a particular editor or house looking for the enthusiasm-provoking kind of ms at that moment; maybe there was something especially wonderful about the writing, rather than the niche, that appealed; maybe you came up against a pure personal taste issue unrelated to what will or won't sell and do well.