how to correctly enable DNS over HTTPS

The https://my.nextdns.io/ creates temporary account even without registering, so I did quick test with that, and it works. Only server addresses are slightly different:

/ip dns static add name=dns.nextdns.io address=45.90.28.0 type=A
/ip dns static add name=dns.nextdns.io address=45.90.30.0 type=A
/ip dns static add name=dns.nextdns.io address=2a07:a8c0:: type=AAAA
/ip dns static add name=dns.nextdns.io address=2a07:a8c1:: type=AAAA

But they probably give differerent ones to different users for load balancing. And id is some six characters long string.

One more idea, what RouterOS version you have? There’s currently some problem with certificates in v7 and it fails with verify-doh-cert=yes (see this thread).

You can also try more detailed logging:

/system logging add topics=dns