David's response is moreso that he can go down to the grave but that his kid can't come back up to him, which is why he had ceased mourning after the child had died. Though on this principle an interesting case can be found in the death of Jeroboam's child. We know that Jeroboam was incredibly evil in that he created new gods and idols to those gods because he feared that Israel would defect if they went up to Jerusalem. We also know that all the rest of Jeroboam's lineage were evil by reason that they maintained the cult of Jeroboam's false gods. Yet when Jeroboam's son falls sick and his wife goes to inquire of the prophet Ahijah the prophet remarks something very interesting.
1 Kings 14:5-13
5 And the Lord said unto Ahijah, Behold, the wife of Jeroboam cometh to ask a thing of thee for her son; for he is sick: thus and thus shalt thou say unto her: for it shall be, when she cometh in, that she shall feign herself to be another woman.
6 And it was so, when Ahijah heard the sound of her feet, as she came in at the door, that he said, Come in, thou wife of Jeroboam; why feignest thou thyself to be another? for I am sent to thee with heavy tidings.
7 Go, tell Jeroboam, Thus saith the Lord God of Israel, Forasmuch as I exalted thee from among the people, and made thee prince over my people Israel,
8 And rent the kingdom away from the house of David, and gave it thee: and yet thou hast not been as my servant David, who kept my commandments, and who followed me with all his heart, to do that only which was right in mine eyes;
9 But hast done evil above all that were before thee: for thou hast gone and made thee other gods, and molten images, to provoke me to anger, and hast cast me behind thy back:
10 Therefore, behold, I will bring evil upon the house of Jeroboam, and will cut off from Jeroboam him that pisseth against the wall, and him that is shut up and left in Israel, and will take away the remnant of the house of Jeroboam, as a man taketh away dung, till it be all gone.
11 Him that dieth of Jeroboam in the city shall the dogs eat; and him that dieth in the field shall the fowls of the air eat: for the Lord hath spoken it.
12 Arise thou therefore, get thee to thine own house: and when thy feet enter into the city, the child shall die.
13 And all Israel shall mourn for him, and bury him: for he only of Jeroboam shall come to the grave, because in him there is found some good thing toward the Lord God of Israel in the house of Jeroboam.