Hard boiled eggs can cause gas and bloating due to factors such as food sensitivities, irritable bowel syndrome (IBS), eating habits, and the high sulfur content in eggs. Scrambled eggs may not have the same effect because they are cooked differently and may have a lower sulfur concentration.