What does “-501 0D” mean when trying to run the Apple Hardware Test?
Brief follow-up note: it turns out this Mac did have hardware problems.

I took it to the Apple Store a few days after writing the original post, and their more thorough diagnostics discovered a problem with the disk (specifically, the hard drive portion of the Fusion&nbsp;Drive). I got the hard drive replaced under warranty, and after a year I haven‘t seen the symptoms again – I assume this was just an artefact of a failing disk.