Most people experience bloating from carbs at some point, and the fermentation explanation others mentioned is real - but it's not the whole picture, and the inconsistency you're describing actually matters more than you might think. Your digestive system isn't a machine that works the same way every time. Stress, how hydrated you are, what else you ate that day, how much sleep you got the night before, even your menstrual cycle if you have one - all of these shift how your gut handles food. So yes, sometimes bread and pasta will bloat you and sometimes won't, and that's completely normal. It doesn't automatically point to an intolerance.
That said, if the bloating is severe, lasts for ages, or comes with other symptoms like stomach pain, unusual gas, or changes in your bowel habits, it's worth paying attention. Keep a rough note of when it happens - what you ate, how much, what else went on that day - and see if patterns emerge. Most people find that eating slower, chewing properly, and managing their stress makes a real difference. If it keeps happening consistently with specific foods despite all that, or if it's genuinely affecting your quality of life, then it's worth getting checked out, but for now the inconsistency you're seeing is actually a sign this is probably just normal digestion doing its thing rather than a food intolerance.