Further analysis: race condition.
Being a programmer with over 30 years experience (currently JavaScript, C, C++, C#, .NET, Java, etc), I notice code runs afterwards if I'm already logged on. Occasionally the order of execution swaps and it stays correct.
The two scenarios are happening:
(1) It jumps to correct location then jumps back to top.
(2) It jumps to correct location then stays there.
I am able to make software execution occur in a different sequence by intentionally slowing down Google Chrome as follows:
1. Open Developer Tools
2. Click Console tab followed by device toolbar button
3. Select "Low End Mobile" to emulate loading website on a slow laptop (keep everything else at default, "Responsive" and full resolution)
4. The race condition more erratically disappears (Code X executes before Code Y, and bug disappears, permalinks work properly even when logged in).
Also frequency/odds behaviours seem to vary if you reload, if you re-click, or if you paste into new tab, but those aren't reliable indicators.
I don't have time to do anymore volunteer debugging this week, but hopefully this gets your web programmer closer to a solution. Seems to feel like a race condition of some kind. Maybe some kind of "Go to top of page" behavior running, fighting against "Jump to this section" behavior in code execution sequence.
Hopefully this is not a hardcoded behaviour of a toolkit, and is an easy fix on a hard-to-find bug. Maybe someone else could do a deeper debug trace.