Passenger side headlight won't light, not the bulb

97 XJ6 - The passenger side main beam stopped working. I checked the bulb and it lights up when connected to to a good battery. I also tried a new bulb and another good used one and none of them light when connected to the harness. I put a meter on the harness and I get 13.9 volts. I am very confused. I have a parts car and I tried exchanging the harness section to no avail. Does anyone have any ideas what could be causing this,
Thanks in advance.

I suspect you get 13v when the bulb isn’t connected?

If Yes> a poor connection somewhere. Wiggle fuse
If No > Is a problem with the bulb earth

Andy,
Thanks, I got 13V without the bulb. After a short drive the bulb came back to life and has not gone back out. It looks like there must be a poor connection some place. I will keep looking.