Suppose that the dragon is outside. If it flies a half mile above the party and has access to the Feather Fall spell (variant spellcasting dragon), then it can start a turn by folding its wings, falling to just above the party, cast Feather Fall on self, breath weapon everyone, then fly 80 feet away. Repeat every few minutes to waste party resources. If they split up, fly down to one, grapple, shred with multiattack, and drop. A sharpshooter in the party will stop this working entirely, but an average party would be easily defeated by a young dragon. An adult would likely be too much.
Dragons need immunity to nonmagical weapons brought back for the older ones, real magic resistance (advantage on saves is useless vs spells with no saves), spell caster levels, and automatic fear effects on low CR critters at a minimum.
RE: real magic resistance, you could give replace Legendary Resistance with the ability to expend its reaction in order to roll a MR check (10%/30%/50%/70% for different age categories).
Dragons have a couple of design flaws. Their DPR is all in their breath weapon, and they don't have the HP to stand up in a toe to toe fight. This makes them quite a swingy fight. Roll a lot of breath recharges? The fight will be deadly. Bad luck on the breath recharges? The fight will be underwhelming.
You mean an average party doesn't have a ranged capability? Whyever not?
The average range of most spells is simply too short to deal with this tactic. The dragon bypasses all risk before attacking by staying well beyond everyone's range. In a single turn it stops flying, falls to 50 feet above the party, casts featherfall to catch itself, breath weapon on everyone, flies sideways 80 feet. It's not 94 feet from the party. All weapons except heavy crossbows and longbows are now at long range. The majority of spells are also out of range, though there are some outliers that will still work.
What I am experienting on with Drow is a flat number that you have to beat on a d20 roll. 11 for example. This is similar to 2E MR but in effect uses increments of 5%.

(Dungeons & Dragons)
Rulebook featuring "high magic" options, including a host of new spells.