ensurePrimary doesn't work fine
I had a route which I put await ensurePrimary() on the loader because I was doing a update() request with prisma, and including await ensurePrimary() on the loader, was making all the links to that loader (both with useNavigate and remix Link) to reload the current page instead of go to that new page.
So I ended removing ensurePrimary(), and the links worked again.
Can you make a reproduction?
Well, it's not that easy to reproduce, because it doesn't happen to all users.
I'm afraid I don't have bandwidth to investigate this. But I'd be happy to look at a pull request if you work out what's going wrong.