The reason was a malformed bearer token.
This is because I read the token from a file using
let master_key_file = env::var("MEILI_MASTER_KEY_FILE").expect("MEILI_MASTER_KEY_FILE must be set");
let mut master_key = String::new();
File::open(master_key_file).await.unwrap().read_to_string(&mut master_key).await.unwrap();
which magically appends a newline to the end of the string in the file. This needs to be stripped off.