Consulting the text of the Golden Bull, I couldn't find anything that explicitly forbids one man from holding two electoral titles, though it's worth noting that there are several passages that clearly assume that the two are different people (for example, with regards to how they are to be seated at coronations of the Emperor, or the order in which they are to march in procession). The best I could find is
Within the imperial place of session tables shall be prepared for the seven prince electors, ecclesiastical and secular,-three, namely, on the right, and three others on the left, and the seventh directly opposite the face of the emperor or king, as has above been more clearly defined by us in the chapter concerning the seating and precedence of the prince electors; in such wise, also, that no one else, of whatever dignity or standing he may be, shall sit among them or at their table.
...which seems to explicitly say there should be 7 of them. If I were someone who wanted to challenge the legality of one person holding two electoral titles, I'd do things like ask them to sit in two such chairs at the same time, and stuff like that. I suspect it would go to court and probably end up in Papal court.
Of course, the King of Bavaria is not an elector in this scheme anyway. The Peace of Westphalia, which formalizes the transfer of the Count Palatine's vote to Bavaria, doesn't seem to much touch on the subject, except, again, to assume 7 electors when discussing a hypothetical 8th electorship that can never exist for the Count Palatine.
So, legally, it's ambiguous. In practice I suspect the other electors wouldn't like it. They'd probably either force Charles to give up one or the other title, or allow the Bavarian electorship to revert to the Count Palatine (as Westphalia mandates it do so in the even that the Bavarian royal line dies out)