The problem is most likely a bad ground at the tail lights, VERY common problem and BMW even had a recall on it, and upgraded bulb holder with extra ground cable. In rare cases the headlight switch (module) can also do this.
Another common problem with the flashing HID's is the ballast or igniter, but if BOTH lights do it at the same time, i would look at the ground/module first.
As to the aftermarket lights, most are complete garbage, would never put or suggest anyone putting it on a BMW. They leak, fail, and in some cases melt or catch fire. I have seen melted aftermarket ballasts only after a year!