my 2002 factory shop manual for Legacy/Outback has a wiring diagram for the 2-light system and it shows 3 terminals at the bulbs, but the bulbs on the car (and the bulb connector) only have 2 terminals.
There's two headlight assembly versions; one that uses separate low and high beam bulbs, and one in which the low and high beams are within the same bulb.
In the wiring diagram (which shows both versions if it's the same as the one I have -- see attached), connectors F7 and F23 are three pin, just as you noted. But there's wiring going from those connectors to the headlight assembly and the bulbs. This short harness isn't clearly shown in the diagrams. In the two light system the short harness has three wires and this goes to a single three wire connector at the bulb. In the four light system, the short harness splits into two, and two wires go to each of the two bulbs in that headlight assembly, so in this case the connector at the bulbs themselves have only two terminals.
Nevertheless, the way the headlights are powered and switched is the same in both cases. (It's only the wiring between F7 and F23 and the bulb sockets that is different.)
Furthermore, the bulb base is plastic and it sure doesn't look like any path to ground.
Subaru headlight systems switch the low, or ground, side. In the four bulb system (each bulb socket itself has two wires), one wire is the 12 V coming from the corresponding headlight relay. The other wire goes to the switching control, not directly to ground.
In the attached diagram, in the 4 bulb system, pin 3 of F7 or F23 is the 12 V supply. Pin 2 is the low beam control -- this goes to the daytime running light control module connector B242 terminal 5, which grounds the line through a resistance in the module so the low beam light is on at reduced intensity (DRLs). When the headlight "lighting switch" is turned to the second position for the low beams, the daytime running light relay is energized, and this grounds the low side of the low beam bulbs for full brilliance. Similarly, pin 1 of F7 and F23 go to the daytime running light control module which will turn on the high beam bulbs when the "dimmer and passing switch" is set for high beams.
Another inconsistency is the car has separate LH and RH headlight relays but the wiring diagram only shows a single relay for both lights.
My 2002 wiring diagram show separate relays. On the attached Headlight System page the high side of the left and right headlights (pin 3 of F23 and F7 in the 4 bulb system) go to MB-10 and MB-11 respectively. Tracing these connections at the Power Supply Routing pages, they connect to separate left and right headlight relays.
I also tried disconnecting the light at the connector next to the light housing (which does have 3 conductors). I found when measuring relative to the middle terminal, 12 volts on one (end) terminal with low beams on and 12 volts on the other with high beams. What is going on here??
With F7 and F23 disconnected, you should have 12 V at the connectors' terminal 3 (measured to a good ground) when the Ignition switch is at ON even with the headlight switch off. If the 12 V is there, then the headlight relays and power to the bulbs are okay.