It might not be gluten (protein) that is affecting you, but the fructans (carbohydrates) that are found in wheat, rye, and barely which are high in FODMAPs.
Look into low-FODMAP diets if you haven't already.