In a multisite solution, cross-site links might get rendered incorrectly when sites have the same rootPath. The cause of the issue is ignoring the StartItem during site resolving. The issue occurs in solutions that use cumulative hotfixes released before February 2023.
For example, for two custom site definitions, where "/sitecore/content" is the rootPath, and "/StartItem1" and "/StartItem2" are StartItems for the first and the second sites, the expected result is:
https://site1.local/Link https://site2.local/Link
The actual result is:
https://site1.local/Link https://site2.local/StartItem2/Link
To resolve the issue, consider the following options: