Most machines try IPv6 and IPv4 at the same time and use whichever connects first. That hides a broken AAAA record, because the other family quietly takes over.
Force one family per run and print the address curl used:
curl -4 -s -o /dev/null -w '%{remote_ip} %{http_code}\n' https://example.com/
curl -6 -s -o /dev/null -w '%{remote_ip} %{http_code}\n' https://example.com/
-4 makes curl resolve the name to IPv4 addresses only, and -6 to IPv6 only. When both lines show a status code, the site works over both. If the -6 line fails with exit code 6 or 7, either the name has no AAAA record or the address does not answer, and visitors on IPv6 networks may see slow page loads while their browser falls back.
I’d run this after adding an AAAA record to a domain, or after changing firewall rules, since IPv6 rules are easy to forget. It is also a quick check on whether your own connection has working IPv6 at all.
Read the address too. If -6 shows something like ::ffff:192.0.2.10, that is an IPv4 address in IPv6 form, often from a VPN or NAT64 setup, so the request did not travel over real IPv6. And a failure on -6 can just as well be your own network as the server, so test from a second place before you blame the site.
Further reading: curl man page