First of all, don't let people turn money into magic items.
If you let people turn gold pieces into planet destroying superweapons, then you get these sorts of problems. This is something 5e specifically tried to address (although in a half-assed way) by not listing gold piece prices for magical items.
Getting magical items should always be a quest, in 5th edition DnD. Even if the quest involves spending copious amounts of money, that should not be the only factor in acquiring the item.
Second of all, keep in mind that DnD is not our world.
In our world, especially if you are not excessively rich, it's common wisdom that 'money solves all problems'. DnD is a world where problems are solved largely by magical superpowers and/or items that grant magical superpowers. The ability of one hundred men with longbows is strong, but certain CR3 encounters will ignore them entirely, and the cost of outfitting, fielding, training and paying even 100 longbowmen is quite exorbitant.
Lower level PCs might do things for money, to pay for drinks, lodging, full plate armour, fancy maps, prostitutes, and bards to sing songs about them. But finding even a 6th level fighter willing to risk his life for you for something as simple as gold - rather than prestige, loyalty, honour, favours, or magic items - is quite hard. If you do, it might be because you lucked out - he ran out of ready money and is willing to fight an easy battle for a few thousand gp - rather than there's a line out the door of 6th level fighters willing to die for a few platinum pieces.
Establishing economic leverage over a city state so they are forced to send their national heroes to come fight this Wyvern Problem you have is more realistic - they're bound by honour and family to answer the call, and you've established controlling interests in three of the city's five major trading houses thus ensuring there is a call for them to answer.
Third of all, steal their stuff.
They have cool stuff. Bob McGithyanki needs their staff of the magi to fight his Planar War. Divination has revealed its existence to him - and these are by far the easiest-to-fight people holding onto a stave of the magi. Maybe he even gives a tortured anti-hero speech about the greater good as his planar dragon is busy wrecking the wall of the heroes' vault after he planeshifted in and caught them on the hop.
This is great! Now you've got a fun side quest where they try to get back their stuff! He steals the staff of the magi but y'know, they have a bunch of stuff and he's already here... odds are good he's going to take as much as will fit in his magical sack o' loot.
By the time they find him and blow up his planar fortress and effectively make sure his people will be enslaved by his evil enemies etc etc, he's lost, bartered, or used up a lot of their gear. They get back some of it but not all.
Insert <whichever enemy you'd like to put in next> instead of Bob btw. It's just funnier if the only reason he's here is because their gear is poorly defended and they're low level and he's from literally another plane of existence.
Fourth of all, Break Their Stuff
They have enemies, right?
The magic items are a clear point of weakness. The huge walking fortress sounds horrendously vulnerable to a kill team with magical munitions breaking into the engine room or the leg joints maintenance tunnels and just... doing some saboteuring. A guy who is killing you largely thanks to his artifact sword? Why not just.. steal it? Disarm it and run off with it? Try, at least, to take it.
No reason enemies have to succeed at all this. The party can outsmart them, outroll them. The magic items might have some weird ability that the enemies don't know about, like the artifact sword is 'bound' to its owner and can be summoned back with a gesture or something. But by forcing them to think of the magic items as potential points of weakness (horrifying if they have less than 100hp and someone got that overpowered ridiculous sword off them even for a turn) they have to invest time and resources into guarding them (perhaps they build a dungeon? :D) and that's time and resources they don't just spend facerolling the campaign.
If Evil Man 5 steals the Sword of Overpoweredness even once they get it back they've just gained xp and had to solve problems without the Sword of Overpoweredness. If Evil Man 5 nearly steals the Sword of Overpoweredness and they get worried and design a fancy super vault to keep their gear in and only take out the Sword of Overpoweredness if they really really need to? That's also good.
Note: 'Magic Based Economy'
This typically means an economy where magical goods and resources are common and traded, but all examples I can think of specifically place magical resources as being more valuable than mundane ones, creating a two-tiered system of trade. Often, only the weakest magical baubles will be available for mundane goods (such as in eberron) and stronger magical items require magical resources to trade for them, truly horrendous amounts of mundane goods (like trading companies, or cities), or political connections to effectively requisition them.
Gold coins might be valuable to a peasant but they are not so to a wizard who sells his scrying services for magically active gems, potions, and fine scrolls. Transforming gold coins into magical objects or services in such an economy is likely to be very difficult - you're effectively 'trading up', and people willing to take that deal are unlikely to be common and will likely gouge you incredibly heavily.
If you wanted to run an economy where mundane and magical goods are equally valued and freely interchangeable to the extent that Artifacts are traded for chunks of metal, then likely the chunks of metal should be valued by people as much as artifacts, and theft (of platinum coins) should be a very large concern for a lot of people. Basically the ol' 'why should I sell you these artifacts when I could use these artifacts to take your money worth more than the artifacts?', and/or the 'steal their shit' but like turbo edition. I find it hard to imagine a world where platinum was as valuable as a sword that lets you defeat dragons though, and I could only imagine it where platinum is a component for something equally valuable to people - like immortality serum, or bringing the dead back to life which is otherwise impossible.
Further Note: Money
In our world, international agreements and the deadly sword of Finance keep money solvent. Money is money, it can be exchanged and spent pretty much anywhere. Yet if you, a random plebeian, tried to suddenly spend twenty million us dollars all at once your accounts would be frozen and men would ask you a lot of questions.
Fantasy medieval worlds are unlikely to be as interconnected or spend-happy as even our world. If you show up with a pile of platinum coins, why would people let you spend them? Where did you get them? You just devalued the currency owned by all the local powerful people by trying to drop several hundred on something - they have a vested interest in making sure those coins don't enter circulation. If they're even real and not fae illusions or planar platinum or something.
These rich people have power other than money - that's why they can spend their money how they like. They've got magic items, and wizards who are loyal to them, and favours owed, etc. You just pissed all of them off by trying to lower their value of their money. You're not part of any of their old-boy networks, and the only power you have is your personal skill with a sword. So perhaps they'd let you spend some of your money - they'd take a cut, and you'd pay approximately 8000% of what they'd pay for the same thing - but all of it? And to get magic items and capabilities that dwarf their own? That would not happen without a fight. And probably, some copious stabbing.