It seems that currently using the Opt-Out link on pages causes the Matomo URL in the DB to be updated using the link from the Opt Out.
For people using multiple URLs for tracking or that are using a different tracking URL than their UI URL this can cause issues, especially with certain types of emails (I.e. Tracking failure emails) that use the URL from the DB.
depending on the final solution this could maybe be solved with #17452
I believe this is solved by https://github.com/matomo-org/matomo/issues/17452, close this issue.