Ah, misunderstood.
Ions cannot exist in isolation, they must be 'paired' with another ion of opposite charge. Carbonate and bicarbonate are anions, that is they are negatively charged, so they have to be paired with positively charged cations - such as magnesium and calcium. But it's the carbonate and bicarbonate which react with acids so those are the buffers. Calcium and magnesium are present but they do not take part in the buffering.
Calcium and magnesium carbonate and bicarbonate are salts and, by definition, any soluble salt totally dissociates in water into its ions. The calcium and magnesium ions are not physically bound to the bi/carbonate ions, they are just in the water at the same time to balance the charge. They don't take part in the buffering process so we can't say that calcium and magnesium are buffers, just that the bi/carbonate ions act as buffers.
Ions cannot exist in isolation, they must be 'paired' with another ion of opposite charge. Carbonate and bicarbonate are anions, that is they are negatively charged, so they have to be paired with positively charged cations - such as magnesium and calcium. But it's the carbonate and bicarbonate which react with acids so those are the buffers. Calcium and magnesium are present but they do not take part in the buffering.
Calcium and magnesium carbonate and bicarbonate are salts and, by definition, any soluble salt totally dissociates in water into its ions. The calcium and magnesium ions are not physically bound to the bi/carbonate ions, they are just in the water at the same time to balance the charge. They don't take part in the buffering process so we can't say that calcium and magnesium are buffers, just that the bi/carbonate ions act as buffers.