Clarification on Batch API Order for DNS Record Management

For Workes & Pages, what is the name of the domain?

cheengsolutions.com

What is the issue or error you’re encountering

It appears that the Cloudflare batch API is supposed to perform operations in a specific order—deletes, then patches, then puts, and finally posts. However, even with this order, I encountered an error indicating that an MX record already exists while attempting to post new records

While it sounds like you’re doing what the documentation says, why aren’t you PATCHing or PUTting the existing MX record(s)? You already know the IDs.

At what point did you get that error? Was it in the response body that lists all the changes in order? Was the delete successful? That’s what it looks like it should do, according to the API docs:
https://developers.cloudflare.com/api/operations/dns-records-for-a-zone-batch-dns-records