Agreed.
This is illegal and you could lay a complaint and have the landlord prosecuted.
The act is clear on three specific things applicable here:
1. Cancellation penalties may not be prohibitive in a manner that would force the consumer not to cancel, which is clearly the case here.
2. Cancellation fees must be reasonable. The landlord cannot claim 3 months rent and other expenses, with the exception of actual damages caused by you, which must be shown on both inspection reports when you moved in and out. If there are no inspection reports or one is missing, he has no claims for damages. This was already made clear in a number of RHT cases. At most, the landlord has 20 days to find a new tenant and could claim any advertising costs he had in finding one. If he can't find tenants in 20 days, you are not responsible for any losses.
3. No person is allowed to draw up a contract that bypasses the CPA act, which is clearly the case here.