there is no error, the shutdown command returns a zero.
strange

It just won't do the shutdown on a locked workstation. In any other situation the shutdown works.