"Thou shalt not kill", is the most overt mistranslation in the Old testament. Ancient Hebrew only had about 8,000 words as opposed to modern English with over 120,000 words. It was difficult to express nuances without placing a word in context, especially in an oral tradition. They just didn't have the words for executions, battle deaths, suicides, homicides, fratricides, etc. But clearly the commandment was intended to mean "thou shalt not murder". The original Hebrew of the sixth commandment is lo tirtsach. Tirtsach can mean to break in pieces, kill or murder. Lo is the Hebrew negative.
In fact, in the first five books of the bible, death by stoning is prescribed for breaking any of the first 7 commandments except possibly the second. Surely the commandment did not include killing by execution.
David and Solomon were beloved of God yet they slew "thousands and ten-thousands" in battle. Surely the commandment did not include killing in battle.
"Thou shalt not murder", while not traditional in the King James Version, is actually the proper translation of the Sixth Commandment. It just did not survive multiple translations from Hebrew to Greek to Latin to English unscathed.
Even then, there are contradictions. When Joshua destroyed Jericho he committed overt genocide at the word of God. Murder of the innocent.
Joshua 6:21 -- Then they utterly destroyed all in the city, both men and women, young and old, oxen, sheep, and asses, with the edge of the sword
The God of the Old Testament is NOT a benevolent diety. YHWH is a vengeful, jealous, and tyrannical god who would flood the world for the insufficient righteousness of its people.