Don't eat a ton of beans if you care about your iron or magnesium levels.
https://en.m.wikipedia.org/wiki/Oxalic_acid
https://en.m.wikipedia.org/wiki/Phytic_acid
"Phytic acid and phytate have a strong binding affinity to the dietary minerals calcium, iron, and zinc, inhibiting their absorption in the small intestine. It is also present in many legumes, cereals, and grains."
These are chemical bio-defenses developed by the plant to stop being eaten. Cooking reduces the levels somewhat, but it's like suggesting to eat Fugu to increase your Omega 3 levels. There are better sources.
You can eat black beans for one meal and your next meal won't be affected.
If magnesium from plants is so hard to come by due to scary chemicals, how come it’s not a nutrient of concern for plant based eaters? They tend to have better magnesium levels if anything.
Random example: https://pubmed.ncbi.nlm.nih.gov/15454974/
And if you will be drinking water and consuming diuretics like tea or coffee and picking a stressful occupation like tech you're better off having a supplement in addition to your dietary magnesium.
Better that than the self reinforcing doom loop of stress + diuretics + magnesium deficiency = mental health crisis
"Tannic acid (TA) is an organic compound belonging to the tannin group. [...] It can also form complexes with mineral components, reducing their absorption. In some cases, this can be beneficial, such as in the case of toxic metals, but sometimes it may have a detrimental effect on the body when it involves essential mineral components like Ca, P, Mg, Na, K, or Fe."
https://www.ncbi.nlm.nih.gov/pmc/articles/PMC10609055/
The effect of phytochemicals in our diets, the only form of defense plants have against being eaten, is severely under-researched, and completely ignored by most drive-by dietary advice. As I said elsewhere, cooking helps, but the dose makes the poison. You won't fare well with a diet of beans, spinach and a ton of coffee or tea, that's for sure.