In my view what is important is the date when the divorce became legally binding. Was it binding from the point at which you and your ex-wife signed it in 2020? This depends on the divorce law of the country the divorce took place in. In such a situation, you were eligible to marry when you did so in Denmark and the documentation around the divorce simply came out later.
According to the Danish authorities, if you wish to marry there, you have to provide evidence that you are divorced from any previous marriages. The fact that they allowed you to marry indicates that they checked this. Their website states this:
If you have previously been married, you must enclose documentation that the marriage has been dissolved by divorce, death or annulment:
- photo or copy of divorce decree or
- photo or copy or death certificate
- photo or copy or marriage annulment.
If the divorce did, however, only become legally binding on a date after your marriage in Denmark, then I advise you to seek legal advice as this would have serious implications on the validity of your marriage, residency status and family reunification.