Troubles executing import/migration scripts

Standard install, following discourse/ at main · discourse/discourse · GitHub

The only thing I did (that I can think of now) since it was working last time was reverting to backups.

What confuses me about the error is that everything else works. The site works perfectly fine. Only the import script fails.