CNAME and MX cannot coexist, and mail breaks when they try
Pointing the apex example.com at a CDN with a CNAME stopped all mail: DNS forbids a CNAME alongside other record types, so the MX records disappear.
Use A/AAAA at the apex — or the provider's ANAME/ALIAS flattening — and CNAME only on www. MX, SPF, DKIM and DMARC records belong on the apex.
When mail breaks, check in this order:
dig MX example.com
dig TXT example.com
dig CNAME example.com
A CNAME answer with an empty MX confirms it. Wait for the TTL after fixing; mail does not recover instantly.