Maybe the Dragon could have done something better, but that doesn't necessarily mean it would.
The AVERAGE young adult black dragon has an int of only 12 and a 13 wisdom. Slightly above average, but basically a lot dumber and more foolish than many humans. It is also only 51 years old, a young adult, basically the equivalent of a 19-20 year old human - a teenager.
Teenagers can do foolish and rash things, and I think Dragons are probably no exception to this. I think it is not so much that older dragons are clever but instead that only the really clever dragons ever get the chance to grow old.
Really, that this encounter went the way it did was a fluke. It should have been a reasonable risk for the Dragon to do what it did. It just got very very unlucky.
I don't buy the idea that all Dragons are perfect strategists, especially when they are young, inexperienced, and have a lot less intelligence and wisdom than a good chunk of humanity. If anything, they would be more reckless than you would think - just being a dragon would intimidate most people into groveling, cowering, or running. If you get used to that, you aren't going to be very prepared when you do your swoop down against a group that not only doesn't grovel, but can kill you with a single spell.