As you've noticed, the key sentence to deconstruct is the last one.
In either case, both the object and the creature or solid surface take 3d8 bludgeoning damage.
"In either case" refers to the case where the projectile is stopped by "stopping early if it impacts against a solid surface" versus the case where it is stopped by "the object strikes the target and stops moving".
Then the rest of the sentence is straightforward: "both [the object] and [the creature or solid surface] take 3d8 bludgeoning damage" - [the creature or solid surface] will refer to whichever stopped the projectile, and both that and the projectile itself will take 3d8 damage.
Pretty surely not... the Dragon Slayer weapon says:
You gain a +1 bonus to attack and damage rolls made with this magic weapon. When you hit a dragon with this weapon, the dragon takes an extra 3d6 damage of the weapon’s type.
I mean, it doesn't say "when you hit with an attack", but that's quite obviously the intention. And the Cataput spell is not an attack in that sense. It just does 3d8 damage on a failed save, whether the projectile is a sword or a large bag of feathers.
There is a little bit of ambiguity, because other magic weapons like Dwarven Thrower are clear about what they mean by "hit":
When you hit with a ranged attack using this weapon, it deals an extra 1d8 damage...
Or Frost Brand:
When you hit with an attack using this magic sword, the target takes an extra 1d6 cold damage
So possibly you could read the more loose language in Dragon Slayer as including bonking the dragon with the hilt or any other form of contact. But I think that's a pretty big stretch. I think it's much more likely that "hit with this weapon" means the same basic thing in every case.
The Monster Manual (on Page 11, or in the intro section covering monster statistics on D&D Beyond defines "Hit" like this:
Hit. Any damage dealt or other effects that occur as a result of an attack hitting a target are described after the “Hit” notation. You have the option of taking average damage or rolling the damage; for this reason, both the average damage and the die expression are presented.
... but again, as this is specifically in the context of monster stat blocks, one could make the call that this doesn't overrule the plain-English use of the word in the magic item description. If, as a DM, you'd like to go this way, I think you'd want to come up with some campaign-world-specific reason that mere contact is so damaging to dragons, and consider ruling in a similar way for other magic items to ensure consistency.
Personally, I might allow the loophole in a specific situation: if the dragon is the big boss set-piece encounter of a campaign or at least a major chapter of the campaign, and the party isn't likely to come into situations where they'd be exploiting the extra damage frequently, and the battle is not going their way and this offers a chance to turn the tide with a cinematic "rule of cool" moment — possibly the 3d8 of damage to the sword itself destroys it, releasing a burst of dragon-wounding magic.
Best Answer
Can you fire at an angle? Yes. Does it extend the range? No.
Catapult does not specify that the object flies horizontally. Nor are there any additional rulings from Sage Advice on the matter. Pick a direction and watch it fly.
But no matter what direction you point it, the range of Catapult is 90 feet, at which point it "falls to the ground". While it does not specify whether it full-stops or keeps going, the spell damage only applies to the 90 foot range.
A GM can homebrew that it would continue to sail and roll, but it would use a different damage system, no longer empowered by the spell. A good reference for rolling damage would be the Sphere of Crushing Doom trap from the trap UA, which is a 10 foot wide steel ball that rolls downhill, 150 feet in 6 seconds, and does 4d10 damage on impact with a creature. (Obviously a 10ft steel ball weighs a lot more than anything you could catapult, around 500lbs per cubic foot, so keep that in mind).
There's also the question of damage while the object is falling. This question has an answer that includes a GM-made nifty little chart a GM could use for falling damage.
In the case of a grappling hook or utility use, I'd probably put it to your DM whether it hard stops at 90 feet or not.