The conclusion to this problem (see comments of description) is the following:
The publish task is always operating in the host targt context even if the pipline job is running in a container target.
If a file to be published is a symbolic link whose target only exists in the Docker container of the pipeline job then this will lead to the above pipeline error.
Nevertheless I see this as a bug in the implementation (it should consider the specified target context) or make it obvious in the documentation that the publish task always only operates in the host target context which can lead to problems like mine.