Contradiction with 2 Samuel 10:1-2
In 2 Samuel 17:27, Shobi is shown providing support to David, yet in 2 Samuel 10:1-2, the people of Ammon, including Shobi's family, are adversaries of Israel.
2 Samuel 10:1-2: And it came to pass after this, that the king of the children of Ammon died, and Hanun his son reigned in his stead.
Contradiction with 1 Kings 11:1-2
In the context of forming alliances and loyalties, 2 Samuel 17:27 shows foreign allies supporting David, whereas 1 Kings 11:1-2 advises against forming alliances with foreign nations as Solomon's foreign wives led him astray.
1 Kings 11:1-2: But king Solomon loved many strange women, together with the daughter of Pharaoh, women of the Moabites, Ammonites, Edomites, Zidonians, [and] Hittites; [together...: or, beside]
Contradiction with Deuteronomy 23:3-4
This passage prohibits Ammonites and Moabites from entering the assembly of the Lord, yet 2 Samuel 17:27 describes support from Shobi, an Ammonite, for David's cause.
Deuteronomy 23:3-4: An Ammonite or Moabite shall not enter into the congregation of the LORD; even to their tenth generation shall they not enter into the congregation of the LORD for ever: