Here's the thing about vinegar and beans. Acid and beans just flat do not get along. Acid prevents beans from cooking properly. Actually, acid protects the surface of beans. If you add acid early then the beans will never become fully tender. You can cook them for hours and they will still be kind of hard. Therefore, add any acid near or at the end, at any point after the beans have already become tender. This includes molasses. It is why the tomato paste is added after the beans are already tender.
Some people believe that adding salt to beans prevents them from cooking properly, but that is wrong. Salt does not interfere with beans cooking properly, you can add that at any time, but anything acid will mess them up. Should anyone tell you otherwise, you can now say "Stop! You are wrong." Ask me how I know.
"Because I said so, that's how I know." No, srsly, because I had this problem and because I read chapters and websites about beans. I was mostly interested in the mitigation of a particularly unpleasant side effect of beans.
Fine, gas. Short answer: Beano.
And I ended up discovering a whole bunch of other bean chemistry-related things. Acid keeps the exterior of beans toughened, conversely alkaline, like baking soda, softens it. Cooking with salt speeds cooking slightly while flavoring the whole interior of the bean, just as it does all other seed foods that are molecularly compacted starches which all benefit greatly from salt and mineral-laden salt like sea-salt. Corn or wheat bread or hummus without salt are all totally blah.
You can confirm this easily [+beans +acid] and [+beans + salt] and [+beans +baking soda] .