2007 Legacy 2.5i wagon here. My trunk hadn't been locking for a year now but I was still able to arm the car, I then noticed that the sensor for when the trunk was closed was wonky. Found this thread, pulled the accordion elbow, opened up the tape and was able to find the 2 green wires had severed.
Added new wiring by soldering, everything works again.
Let's hope this all holds !