I've just started in on an issue with a D8 site, currently running Civi 5.25 and Mosaico 2.5.
Emails sent using Mosaico with clickthrough tracking contain a mix of correct and incorrect URLs. If I add a URL to an image that has been placed in Mosaico, then that URLs get correctly converted to something like https://example.org/libraries/civicrm/extern/url.php?u=xxx&qid=yyy Embedding a URL into text in the body of the email, and/or using a button with a URL, they get converted to an incorrect link, of the form https://example.org/vendor/civicrm/civicrm-core/extern/url.php?u=xxx&qid=yyy - and clearly these links lead only to 404s.
If I construct a comparable email using the 'traditional' mailer then the resulting trackable URLs are all of the correct form.
So it looks like Mosaico is doing something weird in terms of constructing the paths for some, but not all trackable URLs.
I've looked at my settings for Directories and Resource URLs, and also looked at civicrm.settings.php and nothing is jumping out at me as being wrong.
I'm not too familiar with D8/Civi, and neither do I know much of the history of the site, other than that I've just updated Mosaico from 2.3x to 2.5 in an unsuccessful effort to resolve this issue.
Where is Mosaico getting the path data from? Why is it constructing some URLs that are fine, but others that are broken? Any clues gratefully received.