Both legumes and potatoes have a mix of digestible and 'resistant' (meaning they're not absorbable but instead fuel the microbiome) starches. The digestable/resistant proportions are about the same across different kinds of white pototoes, but cooking method does matter. There's more resistant in baked, even more in any method that first cooks the potatoes, then chills them. Reheating doesn't change this. Google 'potato resistant starch' for the whole story (including some that's ended up on PubMed). I'd add links, but I'm on a mobile.
Also: some kinds of potato dishes are made this way already, (e.g. homefries, which are made with 'day before' potatoes).
I would *guess* something similar might happen to the starch in rice, but I've seen no data...