I guess to get us towards an answer.
Let's focus on late 1800's USA, or somewhere around that time.
Was it common for this to happen? Where there laws to protect this from happening or to protect a bounty Hunter if this happened?
/u/kingconani has some information that might be useful here: https://www.reddit.com/r/AskHistorians/comments/1v7v10/were_bounty_hunters_around_in_the_wild_west_and/
Hi there! Interesting question, but it's based on the premise that a bounty hunter killing the right person would be excused of committing any crime. You might have seen my previous answer that touches on this situation. To address your question more directly, the answer would be "the same thing that happened to anyone else." To reiterate what I wrote in my previous answer, being a "bounty hunter" was not a separate profession for the most part, but someone pursuing/collecting a bounty was usually someone operating either as a member of a state or local law enforcement agency or someone working for a detective agency. (In much of this era, law enforcement had no official training, and being deputized could take as little as a few words being exchanged.) There were also cases when wealthy individuals or companies posted bounties for people, such as when banks or railroads posted bounties for robbers, but this in no way excused those who committed any crime, up to and including murder, in pursuit of those rewards.
In cases when a law enforcement officer killed a bystander during a gunfight, they were largely acquitted. This happened, for example, when "Wild" Bill Hickok, marshal of Abilene, killed deputy Mike Williams during his fight with Phil Coe, though Hickok was fired from his post as marshal of Abilene soon after. When Commodore Perry Owens confronted cattle thief and reported murderer Andy L. "Cooper" Blevins in his family house, Owens ended up killing Blevins and his brother and wounding another brother, all of whom were part of the fight. Owens also killed Mose Roberts, a guest of the family, who was shot to death by Owens while Roberts was understandably fleeing through a window. The killings were found to be justified. Nevertheless, Owens was haunted by nightmares and guilt for what he had done, in particular for killing the youngest Blevins, who was only 16. Why he was more haunted by killing a boy than for killing an innocent man running away from a gunfight is between Owens and his conscience. When Marshal Dallas Stoudenmire killed an innocent bystander when rushing to defend Constable Gus Krempkau from an attack, he was never charged for it.
(As a sad aside, the Manning clan killed Stoudenmire for killing George Campbell during that fight. Stoudenmire, rushing to Constable Krempkau's help from where he had been eating at the restaurant down the street, didn't realize that Campbell was trying to stop the attack. Stoudenmire just saw Krempkau, wounded and confused, firing at Campbell, whose gun John "Johnny" Hale had grabbed to attack Krempkau with. Stoudenmire shot Hale dead and then, seeing Krempkau shooting at Campbell, also killed Campbell, who at that point had his gun out to defend himself (he had already been wounded twice by Krempkau), but was shouting that it wasn't his fight. Three Texas Rangers who were present testified that they hadn't intervened because they believed Campbell wasn't a threat to Stoudenmire or Krempkau. On the other hand, Captain George Baylor, who commanded those Texas Rangers, wrote to his general that Stoudenmire had acted rightly, since Stoudenmire had only seen Campbell running out with a gun, and Campbell had previously threatened him. When the inquest came in, it left out the killing of the innocent bystander entirely, mentioning only the active participants in the fight. It's probable they just considered the innocent bystander matter cut and dry: a city ordnance read, "No officer shall be liable for damages for any act committed in the proper discharge of his duties.")
As for a person pursuing a bounty, mistaking someone for the person they are chasing, and killing them, I have to admit I don't know of any case of this happening. Arrests, certainly, but not deaths. If anyone does know of such a case, please share!