Did Davud/David (as) covet the wife of a soldier under his command?
It is said: “Davud/David coveted the wife of a soldier under his command. Didn’t God find someone else to assign him a prophet?”
The source of this claim is the Old Testament, not the Quran.
According to the Torah, while David was walking around on the roof of the palace one evening, he saw a beautiful woman bathing. He sent messengers to get her. She came to him, and he slept with Bathsheba, the Hittite Uriah’s wife. She was purifying herself from her monthly “uncleanliness.” Then she went back home. The woman conceived and sent word to David, saying, “I am pregnant.” David, on the other hand, deliberately sent Uriah to the front where the war was most fierce, causing him to die. After Uriah died David had her brought to his house, and she became his wife (OT, 2 Samuel, 11:2-5, 14-16, 26-27).
Although this information in the Old Testament is not included in the Quran, unfortunately, it has been adopted by Muslim scholars, and many comments have been made to alleviate it. The Quran introduces Davud Nabi as someone who always turns to Allah (Awwab – al-Sad  17) as someone who has a good place in Allah’s sight. As a result, this claim against Davud Nebi does not appear in the Quran.