This isn't about trusting the client: it's about your endpoint being able to only accept a SHA256 hash sum from the client (thus: length limited) while allowing the user to input arbitrarily long passwords.
They hash in the browser: the only way they can mess with it by producing silly outputs, but that only hurts them.