Try this before going to the switch.
The dim relay may get very hot, and in the process it heats the wires leading to the fuses. In turn, the plastic fuse socket heats up and distorts. As a result, the contact with the fuse becomes unreliable. After checking that all the fuses are well, connect the headlights and fiddle the fuses laterally. If the contact is intermittent, it should be apparent in the headlights.
I was there. My fuse box had become useless to hold the lights' fuses, and I had to install a second hand wire loom from another wrecked car (the fuse box is not sold separately). Only to burn it again shortly after, as I did not replace the dim relay, which was heating the whole thing. In the end, I did major surgery and installed the complete headlights system separately, with commercial relays:
View attachment 2840562
View attachment 2840564