This started with `package-selected-packages` not behaving correctly. For some reason it only evaluated to about 5 packages, while it listed over 20 in `custom-set-variables`. This continued whatever I did (`-Q` didn't help). So I tried moving my `init.el`. Without an `init.el`, `package-selected-packages` evaluates correctly. However, when I try to put it back, Emacs doesn't recognize it. What's going on?
Edit: apparently, at some point, Emacs auto-generated a `.emacs` file. I've deleted it and `init.el` is recognised now, but the issue with `package-selected-packages` still remains.