What you describing sounds like gastric prolapse, it happens when the food can not be digested in a stomach, very similar to when we vomit. The reasons can be different : the food item is too big, the food is bad or there is infection going on or it could have been any combination of the above. Husbandry could have had influence too if it is too dry or too cold.