If I were in South Africa, why would I ever take out a margin loan in ZAR when I could have it in AUD at a much lower interest rate?
The answer is trivial: as the exchange rate changes one way or the other, that difference will absolutely crush (one way or the other) the almost-irrelevant interest rate.
It's exactly like asking "Why can't I drive my Ferrari after two bottles of scotch?" Try it.
Thus, the basic answer to this question is:
but over the long term, unless there is a catastrophe in one of the currencies, shouldn't these fluctuations even out
Yes that's completely, utterly, totally wrong - unfortunately! :)
It is utterly wrong on two different levels:
(1) Your loan is not over that sort of long-term
(2) Currencies indeed notably do not straighten out over long terms; very much unlike say a commodity (which basically "always cost the same forever"), currencies famously and notably suffer drastic macro-historic shifts
Do note though that what you say is indeed done all the time. Japanese housewives had a habit of doing this in certain decades. Huge financial institutions do it as a matter of course (when they lose billions, they simply get a bailout). People who live in really internationalish places with a real-estate focus (HK, MC etc) do this. Folks who live internationally do this. (I have done it a couple times FWIW, it feels like holding a razor at your throat 24/7 for a couple of years.)
So you're not wrong at all - it's just incredibly risky. INCREDIBLY risky. Screw up and the price of your house just doubled or tripled. Not good.
One way to look at it...
Note that all you are really saying in such gambles is "you are good at guessing currencies and you are going to trade that guess (with a massive amount of money, the price of a house)".
Let's say some currency is trading at "0.7". Let us say God, who can see through time, told you would again be trading at 0.7 in say ten years on Tuesday afternoon.
Note that the assumption in the final sentence of the question is indeed just that.
In that case, you could make billions easily.
Unfortunately (this is point 2 above) it's as impossible to make that guess, as is is to make any guess in trading.
And again unfortunately, point 1 gets you anyway. Loans need to be paid out in "a few years", and currencies move violently, they're hoes.