Interestingly, this is actually possible under Japanese law/legal precedent. If an employee, for example, decides to put in notice and then half-ass their job until their departure date, a company could actually sue the employee and win.
Other Japan-labor-law fun fact: if you are a contract worker, it is literally illegal for you to quit prior to your contract expiry date. Hope you like that job you signed onto!
Obligatory disclaimer: IANAL