One cannot override Hashem’s plan, but one may certainly be punished for trying.
Gemara Sotah 9a, end – 9b:
תנו רבנן סוטה נתנה עיניה במי שאינו ראוי לה מה שביקשה לא ניתן לה ומה שבידה נטלוהו ממנה שכל הנותן עיניו במה שאינו שלו מה שמבקש אין נותנין לו ומה שבידו נוטלין הימנו
וכן מצינו בנחש הקדמוני שנתן עיניו במה שאינו ראוי לו מה שביקש לא נתנו לו ומה שבידו נטלוהו ממנו
וכן מצינו בקין וקרח ובלעם ודואג ואחיתופל וגחזי ואבשלום ואדוניהו ועוזיהו והמן שנתנו עיניהם במה שאינו ראוי להם מה שביקשו לא ניתן להם ומה שבידם נטלוהו מהם.
Soncino’s translation:
Our Rabbis have taught: The guilty Sotah set her eyes on one who was not proper for her; what she sought was not given to her (She is not allowed to marry her lover) and what she possessed was taken from her; (She dies if she drinks the water, and is divorced with loss of her settlement if she confesses) because whoever sets his eyes on that which is not his is not granted what he seeks and what he possesses is taken from him.
We thus find it with the primeval serpent [in the Garden of Eden] which set its eyes on that which was not proper for it; what it sought was not granted to it and what it possessed was taken from it. The Holy One, blessed be He, said: I declared: Let it be king over every animal and beast; but now, Cursed art thou above all cattle and above every beast of the field. I declared, let it walk with an erect posture; but now it shall go upon its belly. I declared: Let its food be the same as that of man; but now it shall eat dust. It said: I will kill Adam and marry Eve; but now, I will put enmity between thee and the woman, and between thy seed and her seed. Similarly do we find it with Cain, Korah, Balaam, Doeg, Ahitophel, Gehazi, Absalom, Adonijah, Uzziah and Haman, who set their eyes upon that which was not proper for them; what they sought was not granted to them and what they possessed was taken from them.