The thing is, you have limited siege material. Especially if we're talking about Dorne. If you spend it on anti-dragon weapons, you won't have enough for your own catapults, in which case the dragon can wait until your scorpions destroy the rocks.
I'm not sure Dorne is actually
poor, but... If my dragons only attack your positions after my own siege train is already in a position to reduce them, I lose a lot of the operational advantages of having dragons. Because I have to maneuver a large, slow-moving army dependent on resupply across the terrain to get to your strongpoint, and my supply lines are vulnerable to your raiding, and my dragons have to spend all their time camped out with the army, and I'm having to pay a double logistical burden to feed both the dragons and the siege train.
Normally, dragons
substitute for a medieval siege train, and in fact do so rather well- they're the equivalent of batteries of cannons and have a similar effect on the viability of medieval fortifications, only more so.
The thing is, even having cannons when the enemy did not didn't mean your soldiers were literally immortal; once in a while a gun would just straight-up explode due to an accident, or the enemy would launch a sally that could destroy the cannons, or something. Dragons, likewise, confer military
supremacy but not
invulnerability.
Or attack another place where you don't have hundreds of scorpions prepared. Or, as I noted, attack at night, when the besiegers simply won't have time to prepare their weapons for firing before they're covered in flames.
As was said, the firing range does not actually reflect the effective firing distance, which is often several times lower, and it further decreases depending on the firing angle.
Well, the underlying proposition isn't so much "I can just straightforwardly counter a dragon with hundreds of massed scorpion/ballistae," it's "repeatedly attacking positions defended by scorpions/ballistae may result in one of them taking you and/or your dragon down
eventually if you do it over and over for many years."
A lot depeends on what you even mean by concepts like "effective" and "ineffective." If a contest between "dragonrider" and "castle defended by a few ballistae" ends in favor of the dragonrider 999 times out of 1000, the following two statements are true at the same time:
1) Relying on a castle with ballistae to fend off a dragon is ineffective, and also
2) Relying on the fact that you personally have a dragon to enable you to conquer an entire continental landmass may not end well for you personally.
...
On a side note, the arguments "the angle of attack can make the dragonrider immune" and "just attack at night" kind of fall flat due to the practical constraints.
First, dragons aren't hummingbirds; they cannot fly in any and every arbitrary direction with equal ease. If I come in against a castle at a very steep dive so that I spend most of my attack run above the effective ceiling of torsion artillery on the walls and towers, I may be in more danger from my dragon failing to pull out of the dive and crashing into the ground than I would be from just taking my chances with the darts of the artillery in a lower-angle approach.
Second, not only are dragons not hummingbirds, but I'm pretty sure dragons aren't owls, either. They don't see perfectly well in the dark. If I make a habit of flying with my dragon at night over unfamiliar (enemy) terrain, there some nontrivial risk of a controlled flight into that terrain, and once again, I am worse off than if I'd just taken my chances with the torsion artillery.
We already know that the Conquerors' dragons were somewhat limited by flying conditions, because for instance at the Battle of the Last Storm, Rhaenys and Meraxes had to fight
on the ground because Meraxes couldn't take to the air effectively in an intense rainstorm.
If I were to try to condense my position, it would be "No, medieval siege warfare cannot fight dragons with even minimal effectiveness. No, this does not mean that as a dragon rider, you and your dragon are fundamentally invulnerable. Use your head for more than just attacks head-on."
The way this is actually portrayed in the setting is "medieval weapons cannot fight dragons
with any realistic chance of success, but if you keep pushing the attack with a dragon again and again and try to wipe out literally 100 or 1000 castles, there is a small but significant chance that
eventually someone will win the lottery and get a shot off that kills you, your dragon, or both."
...That's not a flamethrower, it's a death ray
A dragon vs a scorpion doesn't look like the dragon swinging by, taking a deep breath and then burning the siege engine
It looks like the dragon briefly passing overhead and as it flys by it breathes fire downward in front of it or off to the side and everything in a line some 15 - 20 meters wide and some 100 meters long is just gone, consumed by a swirling hellstorm of fire, there's not even bones left
Well, yes.
Which is why, as a ballista operator, you probably only get one shot (unless the dragon death-rays the position 30 meters off to your left and doesn't hit you on that firing pass or something).
Look, to be very clear, this kind of warfare is, to paraphrase a traumatized military survivor in H. G. Wells'
War of the Worlds, "bows and arrows against the lightning!"
It's just that we've
seen dragons and their riders injured and even killed by medieval projectile weapons, and this includes some of the most experienced combat dragonriders in post-Doom history. Visenya got shot in the shoulder with an arrow at the Field of Fire. Rhaenys was taken down by a ballista shot when she had more actual flight hours than her brother and sister put together. It
happens.