The elf started joking, but this scene got serious again, ouch! Its point was to make clear how dangerous fantasy animals are seen in this society: just like dangerous real life animals. They're not evil, they're wild. That dragon behaved normally for a dragon and wasn't wandering into human settlements, that's about all you can ask from something non-sapient.
As for the elf, Patric specialises in small defense cases, he wouldn't be there if he didn't believe he'd get him out of the manslaughter charge. If he gets the court to focus on poaching, well the dragon did survive, elf boy should get away with a few dozen hours of community service with a little luck.