Thai court removes prime minister over cabinet appointment