It seems that trailing whitespace is ignored in password.txt which breaks passwords that end with a space (which restic allows).
profiles.toml
version = "1"
[default]
repository = "/some/path"
password-file = "password.txt"
password.txt
some password that ends with a space