An obvious example in the U.S. is that even if you have a contract saying you have to work for someone for no pay, forever, with no possibility of getting out the contract, it would be unenforceable because we, as a nation, have decided that slavery should not be legal.
It turns out, many of these un-contractable issues involve the employer/employee relationship... another example: even if you sign a contract saying your employer doesn't have to pay you overtime, that provision would be thrown out if you challenged it, and would probably get the employer in trouble with various agencies, including the IRS.
I am a lawyer, but I don't have experience in this field, and this is not legal advice (you have to hire me for that), but this issue seems like one that a court (depending on the state, no doubt) would find that it doesn't matter what the contract says, an employer can't own everything an employee does.
To emphasize: this is NOT legal advice, don't rely on it, and you really should seek counsel if you are encountering this issue in real life.
Again, I don't actually know for sure - I'm not an expert in this area of law. But I think there is enough evidence in the rest of (U.S.) employment law jurisprudence to indicate that it's not open-and-shut in favor of the employer.
In this case in my state the employer should at least have paid for all the time out-of-work in which op worked on his IP, and with a rate established by op
Employment contracts in particular are subject to a lot of restrictions and protections regardless of what the employer makes people sign, because labor laws.
In this case, giving up IP you made in your free time requires a new contract, because the law also requires a purchasing contract to have clear parameters
https://www.urheberrecht-leipzig.de/urheberrecht-nutzungsrec...