Hello,
Welcome to Microsoft Q&A,
Even though you can query the TXT record, Azure may be querying from different name servers, and propagation might still be incomplete from Azure’s end. Sometimes it takes up to 1–2 hours. Azure retries verification periodically
Azure expects the TXT record to be placed exactly at the root of the custom domain you're verifying. Check that the TXT record name aligns exactly with the subdomain you're verifying. Also try removing all other TXT records temporarily (especially SPF/DMARC), add only the Azure-provided TXT value, and verify.
Please Upvote and accept the answer if it helps!!