I can repro. You can actually see it right here on Meta as an anon user.
If you take a look at this post from an incognito window and open the following link in a new tab, it works, but if you click on it directly, it gives you a 404.
https://meta.discourse.org/my/preferences
This looks like where the problem area could be, but I’m not 100% sure at this point: