There are 3 words at the end of the quote from DH you seem to have missed, "within due limits."
Quanta Cura condemns the proposition that freedom of worship is not an absolute right. DH does not contradict that.