The fact that main beam works, First check pin 33 on the ZFE ( central vehicle electronics) ECU, I have seen this pin overheat before.
Then check continuity between pin 33 and and the bulb connector ( yellow wire).
By disconnecting the ZFE you may cure the problem as it normally has a live feed. (Reset).
The ground is common to dip and main.
If everything else checks out try another ZFE.