Ca and Mg are technically secondary macro nutrients, so yes it is important to make sure you have an appropriate amount of both. Ca:Mg ratio is generally thought to be ideal around 4:1.
This is no factual basis for ratio being of any importance regarding these two elements in aquatic plant plant uptake, nor in terrestrial systems, their ABSOLUTE amounts are important, not the ratio itself. Same with K+ and some of the wonky talk.
This is what Liebig's Law is about and states. There's nothing to do with ratios regarding that law. Folks might waste a bit more of one nutrients etc, and for a farmer fertilizing 4000 acres, this can = a fair amount of $, but not a hobbyists.
I can have 100ppm of Ca and 5 ppm of Mg without any issues, likewise, I can have a Ca of 5ppm and a Mg of 10ppm, again, without any issues.
This is a 40X ratio difference without any impact.
K+, N, P, etc........all behave this way.
You might find some things in terrestrial systems due to concentration being far far more than any aquarist might ever see, where a ratio is so far out of whack, that things causes problems.
But these will be very very far out there.