I ran into this issue a lot, solved it once, ran into the issue again, forgot the solution, and then found the solution again. I’m writing this blog post so I won’t forget next time.
Well, it turns out it has to do with the Minimal Download Strategy (MDS). See Microsoft’s write-up here and some discussion on Stack here. It seems like there should be a way to manage this feature on a page-by-page basis.
For now, I’m disabling MDS via Settings -> Manage Site Features -> deactivate.