The first mapped domain is redirecting to second mapped domain

The subsite has two mapped domains:
-mapped.com
-sub.mapped.com

"Disabled and entered domain should be used" is enabled, no mapped domain is set as primary. The first mapped domain name mapped.com is redirecting to sub.mapped.com.