Sure, it's not guaranteed, but there are lots of ways to shore up your bet: Inspiring Word, Guidance, Portent, and Lucky, to name a few. Fly isn't guaranteed either. If your dragon can cast Dispel Magic (or simply has a handy cultist who can) you end up with a prone warrior kissing the ground. Heck, the dragon moves faster than the flying warrior so the dragon can potentially lead the warrior on a wild goose chase if its lair is big enough, then fly back and kill the rest of the party. I understand that Fly was very effective for you, and that's cool, but in the end nothing is foolproof. Telekinesis is riskier, but the reward is also greater (since if all goes well the dragon will be restrained and therefore a significantly diminished threat).
To expand on this a little bit, relying on melee + Fly against dragons has three failure modes that I know of:
1.) Dragon can Dispel it, inflicting 20d6 and wrecking your chances of hurting him in the process. Only works for spellcasting variants with Dispel, obviously.
2.) Dragon can run out the clock. 60' move Fly spell vs. 80' move dragon flight plus 40' via Legendary action means you're just not fast enough to force the dragon to engage against his will, so he always has the option of simply holding the range open for 10 minutes, at which point Fly goes away. Unless you have some way to induce him to engage (trickery, illusions, manipulating his psychological flaws/ego, etc.), Fly might as well not even exist. I play whites as brutal and stupid, so Fly would work against them, but it wouldn't work against a blue, green, or red unless you had occupied its lair or in some other way affronted its pride and taken face. Maybe it would work on a black because they're so eager to cause pain.
3.) The dragon can eat opportunity attacks in order to deprive you of regular attacks. The way this works:
A. If nearest PC is more than 100' away, close to 100' distance.
B. If nearest PC is less than 100' away, close to within 60' and breath on it, then fly back to 80'. PC has to Dash to fly within melee range of you, and if he does you just use legendary actions to tail swipe him three times for 45 points of damage, then on your next turn you either Disengage (rinse and repeat) or claw/claw/bite him and eat a single opportunity attack. Either way he's not getting more than a single opportunity attack against you each round, and neither is any other PC unless they manage to pincer you (which most PCs aren't smart enough to do). Fly is barely doing him any good at all.
C. If you can identify the spellcasters, eventually step B will lead to the warriors getting 200+' away from the spellcasters, at which point you eat a single opportunity attack to zoom right past the warriors into range of the spellcasters. Now they're the ones eating
your opportunity attacks to get away (barring Misty Step/Dimension Door), and next round you can breath on them or claw/claw/bite. If you do it right, you may even get to watch the warriors fall for 10d6+ in the process.
Counter-countermeasures: The party can deploy counter-countermeasures that speed the warriors up some more. Haste and Expeditious Retreat will both prevent #2 and #3 from working at the cost of an additional concentration slot.
In short, using Fly for melee warriors against dragons is tricky and has lots of ways to go wrong. If that's how you like to play, go for it, but having a strong ranged component to your force is much safer.
None of the above dragon tactics work if the dragon is getting hit for 40+ DPR at long range each round.