I thought that a call to ##vso[task.complete result=Failed;] should make the script step where it is called fail immediately but I have now seen one case in my pipeline where this is not the case.
Is my assumption wrong or there a bug in the Azure pipelines script task?
My build agent is running the task in an Ubuntu Container and the agent itself is a Linux agent.