Hungry for potassium, nothing to to with magnesium.
Add a P/K booster to your line up or increase the dosage if you are already using one.
During flowering, cannabis loves potassium and phosphoros and will strip it from the older leaves if it can't find enough in the root zone, which then causes the yellowing.
Defoliation can make the problem worse by removing the "ready resource" of stored elements in the older leaves.
I would not worry about the red stems, some plants just do this.......otherwise the plant will sort itself out once it get a bit more P and K.