as i noted in another post, some interpreters see the Law and not David as the hero of the DtrH.
even even a perpetual dynasty is subject to the rewards and punishments, then monarchy takes second place to obedience to divine law.
look at Deut 17:14-20