It turns out that one of the bolts doesn't retract with the locking mechanism (the lock is bolted at each end rather than a hooked end and a single bolt). Here's a full writeup in case it helps anyone with similar difficulties (I couldn't find much online).
With gravity to help, the lock works OK,* but with the dodgy end at the bottom it doesn't unlock. This probably explains why I had no trouble before, but this time the bad end was lower than the good end (though almost horizontal). I couldn't lift the tail of the bike on the rack because there was too much (including another bike) in the way.
In the following pictures the red tape marks the bad end. Locked then unlocked with the bad end at the top -- all OK:

Locked then unlocked with the bad end at the bottom -- bolt still visible:

According to the manufacturer tapping the end nearest the faulty bolt should free it up. Actually it's not enough just to tap the end (I used a large adjustable spanner), you have to jiggle the key (in and out of the unlocked position) while tapping away at it. That was less tricky on the bike than testing for this post (but scuffing the paintwork isn't a worry on this bike). Pressing the bolt with a finger and no shackle makes this obvious -- you can't push the pin in with the key fully in the unlocked position, only in a position where it doesn't stay by itself (almost fully unlocked).
I also managed (off the bike, and only the first time) the get a shim into the relevant hole with the lock unlocked and jiggle everything to free it up. There's not much clearance to do this, the drinks can shim had to be bent just right.
*It got worse while I tested it to write this post.