The entire Bathsheba bit is...questionable, at best.
It is a dandy story though. It does show David's "Achilles Heel"!
Also it is meant to convey (I believe) God's incredible mercy and forgiveness. But, David, who is shown in the Bible to be a loving father, bore the brunt of his sin through the death of his baby.
His grief was inconsolable.
David was a many splendored man, both saint and sinner.
The two books of Samuel are among the most thought producing in the whole of Scripture.
When I was a little child in Sunday school I got goosebumps over the story of The Lord calling out to Samuel when he was in the service of Eli.