NodeBB's cache buster is based on its current git hash (so if you've upgraded it will try to send you the new CSS and JS, which works well, but it remains the same if switching themes, which results in your issue)
I suppose the dev team hasn't run into this because we usually run with cache disabled while testing (and because Persona is so awesome so why switch? Kidding)
psychobunny created this issue in NodeBB/NodeBB
Update cache buster when switching themes
I fixed my own issue. Apparently some install scripts fail when run as root (or with sudo). I'm not sure why this is the case, but I got everything to work by running sudo chown -R ralph:www-data /path/to/nodebb && ./nodebb upgrade as a standard user.