This is an interesting case about Billy the Kid. I'm not sure if you have read the tales about his exploits or not, and who knows what is truth and what is an urban legend.
He did, however, make a plea bargain with the State in exchange for his testimony, which was instrumental in arresting key gungslingers of the era. The State renegged on their agreement with Billy the Kid.
He was an escape artist and managed to break out of jail after the State refused to hold up to their end of the plea bargain. The rest, as they say, is history.
Even after death, his body lay behind bars because people kept stealing his tombstone -- twice, in fact. This is his gravesite at Fort Sumner, New Mexico.