I have a lwc that is wrapped in a urlAddressable aura component. I did this so I can navigate to it from a button in a related list in a record page. This lwc has a "go back" button, which simply navigates back to the record I was before. It's a simple navigationMixin call:
So the thing is, when I go to the lwc, and try to go back, the url it generates is this:
And salesforce throws an error saying the record doesn't exist anymore and that I should contact my administrator.
But then, if I refresh my lwc and try to go back, it fixes itself and navigates correctly. What I noticed is that the url it generates after refreshing is this one, which seems to be the correct url:
This url contains the name of the sObject between the /r/ and the Id itself.
Why is this happening? I can't really understand why it would generate two different urls, one that doesn't work right after navigating to the lwc and then after refreshing, the correct one.