Yes, I should have mentioned I have only worked in Japan and Germany so far.
Labor law supersedes the contract freedom guaranteed by the civil code here in JP. And the conditions for demotion are strict here, e.g. maximum ~40 % reduction of salary, new role must be related to previous role, etc.
The burden of evidence lies with the employer, but some try to construct a fictitious narrative. Nothing that holds up in a court of law if you remember to CYA.
It’s especially frustrating if your visa is tied to doing a certain type of job and having a certain amount of salary!
The word unlawful I am using here is 不法 (fuhō) in Japanese which I believe is used a lot in tort law.
Either way, long story short, there is no at-will employment in Japan.