Normally, according to the answer to this question, when a person dies, their spell effects are still in place. When a character with undead controlled by animate dead or command undead dies, I presume this means that their control over the undead continues. What does that mean for the undead?
Animate dead implies that its duration is indefinite. Do these undead remain there and do nothing for the rest of eternity? If their last order is to stand down, do they not even defend themselves?
In the case of command undead, its duration can be rather long. Up to 80 days with feats and metamagic. If an intelligent undead fails its save, could it stand there for a whopping 80 days doing nothing?
Furthermore, if the dominating caster was a Lich, and the Lich's body is destroyed, but their phylactery remains intact, would they still be able to deliver commands remotely if they had communication spells in place with ongoing durations? A simple example in the case of dominate monster where the only stipulation is that they must be on the same plane to exert control.