e.g. the Iraq and Afghanistan wars have cost the UK ~£20b (quickly googled). And a lot of the problems in the region seem to come from the Saudi regime which is pushing an extreme version of Islam. Selling weapons to Saudi Arabia is madness.
As Frederick Forsyth said in one of his novels, arms manufacturing factories once started cannot be shut down when you have outfitted your own armies - hence exports.
Consider nuclear weapons. About eight or nine armies have that, nearly 100% made in the relevant country... those factories were started with the clear condition that they would produce for the domestic market only, they set their prices accordingly, and it worked.
What doesn't work is encouraging people to invest in arms production and later telling them they cannot export. Doing that may work, but the prohibition often fails. And fairly IMO. Those are long-term investments and it's not fair to change the rules on much shorter notice.
There is much to be said in favour of a predictable legal regime, where producing and selling foo is legal this year if it was last year. Where producing and selling weapons is legal iff it was when the Royal Army suggested starting developing the weapons in question.