Q: Why didn't the killing curse backfire in the Forbidden Forest? Why didn't the killing curse by Voldemort backfire in the Forbidden Forest when Voldemort tried to kill Harry in Harry Potter and the Deathly Hallows, while it did backfire at the end and Voldemort died?

A: Because the wand wasn't forced to battle its master. Harry ventured into the forest with intention to die. Also he didn't cast any spell that would cause backfire.

A: In the Forbidden Forest, Harry is not contesting the spell at all. He willingly goes, and lets Voldemort cast the spell.

"But…" Harry raised his hand instinctively toward the lightning scar. It did not seem to be there. "But I should have died – I didn't defend myself! I meant to let him kill me!"
"And that," said Dumbledore, "will, I think, have made all the difference."

In the later battle, Harry is actively resisting the spells that Voldemort casts, and forcing them back on him. So, since he actively "pushes" back the spell, when it reaches the Elder Wand, it disarms Voldemort and completely reflects his spell back on him.
