ICP Mainnet HTTP Consensus Error: "No consensus could be reached. Replicas had different responses"

I’ll just answer briefly, as there are already multiple similar threads on the forum.

Most likely, your implementation works locally because you’re local replica/pocket-ic is performing a single call, while on mainnet the IC performs multiple calls to your HTTPS endpoint and tries to reconcile the answers to ensure they are valid.

In other words, one HTTPS call is executed multiple times, and every response must be identical.

This is generally resolved by using an idempotency key or a proxy (custom solution or using existing tools such as those of this answer).

Also note that your target should support IPv6.

In the future, there might be an option to target IPv4 and skip reconciliation. There should be a post about this on the forum as well.