My nutritionist recently pointed me towards some studies which show that reheating some starchy foods like potatoes and rice increased their levels of resistant starch considerably.
A look through Pubmed and the Lancet's databases showed many studies to this effect.
There is even some evidence that this is true of cooling of these foods. This might explain why that potato salad repeats on you the next day rather than when you ate the freshly cooked spuds.
The same is true with lentils and beans but in this case it's the soluble and insoluble fibres which increase.
I batch cook grains and legumes for convenience, now I understand why they are less palatable when cool! Reheating does not reverse this effect.
There are some 'hacks' with legumes. Try tinned versions as the Oligosaccharides leach into the water. Rinse well before and after reheating. If like mean your prefer the taste of freshly cooked lentils or beans then boil them for 5 minutes, rinse well then continue the cooking process. Again rinse well before eating.
Fibre and starch need not be an IBS suffers enemy!
Good luck