In the long run, yes, even without taking into account the political dangers. But it is also cheaper to buy a house than to rent one. Nevertheless, many people pay expensive rent because they need somewhere to live right now, and can’t assemble the capital to buy.
Similarly, rulers often hire expensive mercenaries because they have the income to rent troops and equipment, but not the capital on hand to train the men and buy the equipment.
And another thing is that the semi-barbarians from the border zone would have been cheap mercenaries, not expensive mercenaries.
Romans and provincials were rich and lived in peaceful lands with a comparative wealth of opportunity. It would have taken large salaries to lure them into a soldier’s life of hardship and danger. But the people beyond the borders were poorer and enjoyed less security and opportunity at home: they would find life in the legions attractive at a much lower salary.
Don’t think of the Romans hiring mercenary units outfitted and trained and with their own leaders, and paying a premium for them. (At least, not until the foederati, who were qite late.) Think of them recruiting foreign lads into Roman units with loyal officers paying them, training them, and equipping them just as though they had grown up in Roman provinces. ‘Mercenaries’ in the Roman legions were mercenaries in the sense in which the French Foreign Legion or the Gurkhas in the British Army are mercenaries, not mercenaries in the sense in which the condottieri were mercenaries. They were career soldiers in a national army which happened not to be that of their native country, that’s all.
A lot were Germans, others Syrians and Dacians. These peoples are often listed as enemies of Rome, but that categorisation obscures the complexities. You might have heard of the great German leader Hermann, whose tribal forces wiped three legions under Quintilius Varus in the Teutoberger Forest during the reign of Augustus. His brother was a loyal friend to Rome.
Think about the French. Were they enemies of the British in WWII? Well, Commonwealth troops and US troops did fight [Vichy] French troops in Syria and North Africa in 1941 and 1942. But there were Free French on the Allied side, and France ended up as a Permanent Member of the Security Council (unlike Australia, which is very unfair). Or are the Iraqis enemies of the USA? The US army has just fought the Iraqi army, and there are Iraqi ‘freedom fighters’ trying to kill US soldiers every day. So naturally you might say ‘yes’. But probably a majority of Iraqis are neutral or favourable to the US, and if the US Army had a Foreign Legion it would doubtless be recruiting Iraqis and Afghans now.