For follow-up discussion and general commentary on the topic. Comments are sorted chronologically.
The fact that God forgave David in his sins BUT he did not avoid the concequences of his actions. Note the wife of David called Bathseba recorded in 2 Samuel noted in Chapter 11. David was involved in an asassination of her husband to make her his wife. God forgave him on his repentance BUT that did not remove the problems with the children and the fact they killed each other and run David out of town to the point they had eliminate the kids involved. Interesting story of how God works.