By definition, malice contradicts the principle of good faith that is requisite in all contracts (in Croatia and many other jurisdictions). As such, the contract would be void. However, entering an unlawful clause in a contract might not suffice as proof of malice. The employer can always insist on his "good faith" and blame his lawyer.
Also, an unlawful clause can be the result of lawyer's malice or incompetence. In fact, when having to choose between admitting incompetence or admitting malice, any lawyer will concede incompetence even if he hitherto acted with blatancy and fraudulently.
As a real-life example, the lawyer who represented one of the people I sued in the U.S. pretended being unable to grasp the pleadings in my complaint. That is, he preferred to fake illiteracy (a clear aspect of lawyer's incompetence) in his attempt to drag my case. This lawyer's "illiteracy" prompted me to file expert testimony stating that the pleadings I filed are indeed intelligible. This was one of several idiotic "tactics" this crooked lawyer made during my litigation. The moral of the story is that no lawyer will admit that he acted fraudulently unless admission helps him avoid worsening his situation.
Back to your matter, page 148 of this document purportedly points to Croatian statutes in the sense that contracts which violate the Constitution Croatia, its mandatory provisions or public morality are null and void.
See also p.152:
A contract is null and void in some cases of defects of consent
(duress [...]).
Without being knowledgeable of Croatian law, I will say that the language in the contract is highly relevant because its terms might portray the form of a partnership or joint venture (for instance, regarding the requirement to invest in the company) rather than a condition for employment.
I encourage you to read the aforementioned document and gain acquaintance with the Croatian statutes cited therein. That might make you aware of other issues and subtleties about your situation that might be going unnoticed by you so far.