[Doctor Faust](https://en.wikipedia.org/wiki/Faust) may qualify as an even earlier proto-mad scientist.  Like Victor Frankenstein he is more of a tragic figure than a villanous one, but he is driven by an obsessive desire for knowledge, and eventually this brings him to commit evil acts (not *just* making a bargain with the Devil, but what he does afterward).  According to Wikipedia the earliest known written version of this story dates to 1587.  I think this is about as far as one could plausibly go in Western literature, considering that the first [*real* scientists in Europe](https://en.wikipedia.org/wiki/Scientific_revolution), good, evil, sane, mad, or otherwise, date to the late 1500s.

I don't personally know of any, but I would not be surprised if an earlier example could be found among the legends surrounding Eastern alchemy.