The whole purpose of the law is to supersede contracts. If you could just write in a contract that law XY does not apply here, you could get rid of the concept of laws.
In general, i feel we need to have courts not just call bullshit in such cases but call bloody murder and arrest those involved. Trying to skirt the law needs to be discouraged by more than "if you don't succeed you get to try again".