Sure enough. I finally spotted that intermediate connector by sticking my phone back there and snapping a picture. Then I got the liner out and tested the blue and brown wires: the connection is open, even though the roof is up and SEEMS to be locked in place. I already tested the switch at the headliner and it's ok. So I guess it has to be either 1) the wire run between the switch and the intermediate connector has a break, 2) the roof is not really locked, or 3) the thing on the locking claw that pushes on the switch when locked is bent or somehow missing the switch lever. I guess I'm making progress, since I suppose I've ruled out a problem from the intermediate connector onward. No other error codes are showing up, so presumably there's not a problem with a module sending a lock command to the claw hydraulic piston, and I've just had that piston, which had been leaking but operable, rebuilt. That does make me think, though, is there some hangup with that piston, although the roof worked ok maybe 20 times since the rebuild. Thanks for all your help so far!