Another possibility is the headamp dip/main relay is faulty when triggered for main. This is one of two controlling main beam, the second being for headlamp flash which appears to be working. If you can identify them and they are both 5 pin ones, swapping over may prove the thoughts.