That's correct - this constructs an operation, much the same as when you use client to set delegate for ... or withdraw delegate from ....
If the key_hash is not a baker, it will produce "Unregistered delegate" error (unless it's self-delegation to register a new baker or to activate a inactive baker). It is currently not possible to de-register a baker.
If it's already delegated to the same baker, it will lead to "Unchanged delegated" error.
Trying to de-register baker with SET_DELEGATE NONE leads to "Forbidden delegate deletion"
Trying to change delegate of a register baker also leads to "Forbidden delegate deletion"
Trying to re-activate an already active baker leads to "Delegate already active"
Trying to register a baker on account with 0 balance leads to "Empty delegate account"