Knew it was too good to be true. OK, with the 8 attacks at full value, only 1/3rd chance to get a 20. With all 20 attacks, you have a 2/3rds chance of a natural 20. Not good enough.
OK, let's compute damage again. The ranger is 40th level, has consistently taken dragon as his favored enemy, so he gets a +18 to damage. I'm going make the weapon +6 to bonus (so that the Force Dragon's DR doesn't apply: 3.5 revision, has the Great Wyrm Force Dragon at DR 25/epic, rather than DR 60/+12, a much lower bar). I will also make the weapon Concussive, so that it does +5 to damage (Magic Item Compendium). Strength for a 40th level Ranger - having a 34 doesn't seem out of line at all, giving him a +12 to damage.
A critical hit allows us to reroll damage plus all modifiers, but not any extra dice. Keen Concussive Dragon Bane weapons of Speed:
d6+ 6 + 5 + 18 + 12 + 2d6 = 3d6 + 41, or about 52 for a normal hit, 96 for critical for the scimitar. The kukri does d4+ 41 + 2d6 (50) on a normal hit, 94 on a critical.
He gets 8 attacks at full bonus, and 4 more at a -5 penalty. I'll assume that these 12 attacks hit him.
I will further assume that two attacks succeeded at a critical (one of each weapon).
So that's 5 * 52 + 5 * 50 + 94 + 96 = 700 points of damage, roughly. It's less than a third of his hit points. The ranger might be able to survive a round of hand-to-hand attack from the dragon.