There can be no such thing as an exact atomic replica of anything, so it's pointless talking about that. Regardless of this, Jackson was not trying to make a near-replica of the books. But his task did not involve a fundamental incompatibility in the way the humour could
work. He could have made a much worse film with better humour. It's just a shame that some of the humour was so bad.
As for the Gimli examples, I agree with
Keeper when he says that some of it was funny. However, the burping, blowing away the ghosts, lines such as
"Let him rot!" and the falling off of horses were just unfunny.
Agree with
BB about the other horse joke, involving Aragorn. I too saw it as a way of joking about the sorrow felt by 'Gorn and Arwen. As to an in-depth analysis of the nature of humour......may I be excused?