Yes, a hernia can cause bloating and sometimes weight gain due to swelling and the possible accumulation of fluid or intestinal contents within the herniated area.