Multiple people have reported a browser-agnostic bug where, in the Vector 2022 skin, after the page loads, the table of contents get deleted. Note, it does not get collapsed into a button next to the page title, but outright removed, visualized as a "flash".
A user said that this only occurs on some pages, but a page where this can currently be reproduced is https://en.wikipedia.org/wiki/The_Favourite (make sure you are logged out). When I profile this, the offending function seems to be changeActiveSection(). In case the issue can't be reproduced later, I've uploaded the profile, which can be loaded in Google Chrome via Dev Tools > Performance > Load profile.
Original report on reddit, with the reporter saying the issue was resolved, but another commenter saying they still have the problem. Also reported on enwiki.
Developer notes
I think this is a cached html issue related to one of our recent toc class changes (perhaps T325032).
From what I've gathered, the issue relates to this line, which looks for a vector-feature-toc-pinned-enabled class on the html element. If it's not present, the following code moves the toc into it's collapsed stated. It's not present when this issue occurs, but if I bypass the cache by appending ?blah, it is present in the html and bypasses the issue.