TBH, I have no idea what my router is actually doing
NAT Loopback or Hairpin NAT / NAT Reflection are the terms you are looking for: Network address translation - Wikipedia
but I circumvented by adding
nextcloud.domain.com
to my internal dns server.
Which is a better way to do it anyways. This concept is called Split DNS or Split-horizon DNS.