Could Someone Tell Me What Disney Animation Movie It Is?

I don’t remember the name of it, but its about 2 friends 1 guy is a bandit and the other is retch and the banded guy cumes to the friends wedding or something…. some sort of book is stolen by a witch of some sort and then the banded frind is accused of stealing it so he goes of to find it and the rich frind is going to get executed if the banded dissent come back so, the guy tolks to the witch she askes em wuld u go back and take ur frinds place in the axicushan, he seas yes,,, she dusent belive him and so he dusent get the book….(if something like this rings a bell plz give me a name) 😀 oh and (sry for the spelling)