I had a cat, Ms Horks Alot. Turned out she was allergic to gluten, but it seemed to develop and worsen over time. And, yes, she'd be OK with brands of food for a while, but then suddenly she'd start throwing up. I blamed it on food production line contamination. Who knows?

Over the course of her lifespan (she made it to 18), she had about 1/2 dozen really bad episodes where she'd get to the point where she couldn't eat. The vet would give her an anti-emetic, sometimes a steroid and she'd pull out of it.