OK I think the problem is with the little bridge rectifier- you can see it in the picture, that little black round thing with 4 wires coming out.
Two wires go directly to the socket and the other two have extension wires crimped on- one of those crimps is loose and making a flaky connection.
I'm pretty sure that's what's going on. The rectifier could be bad but I think a bad connection is more likely.
I would try soldering those crimps. It's a tight area to work in, you'll have to be careful not to melt the wires. If you don't have a soldering iron
you could try re-crimping them with a vise-grip.
Fortunately your transformer is out so you have more room
Don't worry if you damage the bridge rectifier- they are dirt cheap to replace. Be gentle with the relay socket though
For better access you could unhook the two bridge rectifier wires from the socket and pull the device toward you