To work then stop then work again I would look at items doing the switching on/off. Could be thermostat, timer, or main Economy 7 contactor, but poor connection will likely get very hot and fail, but a set of contacts may simply not make some times but make others.
The tank can get full of rubbish, however one would hope that was checked before renewing the element, but in the main the rubbish would just need removing, should not need a new tank.
There are two types of element, those which go into the side of the tank, normally two, and those which go in the top, normally two elements in one unit, the short element connects to boost, the long one to economy 7 and of course two pockets for the thermostats or twin thermostat idea is in all cases the economy 7 is set hotter so even if boost is left on, the short element is only used when tank has cooled down.
With this twin system it seems unlikely both elements would fail, so I would be looking at the control module which selects which element to use, I would guess you have some thing like this
That is what I would be looking at to see if there is a fault.[/QUOT