/bin/sh: 0: pipeline@tmp/durable-abcdef/script.sh.copy: No such file or directory

I am adding Jenkins in Android project and the build my one of my branches in MultiProject pipeline job.

but it is giving “/bin/sh: 0: pipeline@tmp/durable-abcdef/script.sh.copy: No such file or directory”

that is my pipline code:

    agent any

    environment {
        JAVA_OPTS = "-Dorg.jenkinsci.plugins.durabletask.BourneShellScript.HEARTBEAT_CHECK_INTERVAL=86400"
    }


    options {
            // prevent multiple builds from running concurrently, that come from the same git branch
            disableConcurrentBuilds()
    }


    stages {
        stage('Build') {
            steps {
                echo 'Building..'
                sh '''
                echo "This is a temporary script" > /workspace/script.sh.copy
                '''
            }
        }
        stage('Test') {
            steps {
                echo 'Testing..'
                // Add steps to test if needed
            }
        }
        stage('Deploy') {
            steps {
                echo 'Deploying....'
                // Add deployment steps if needed
            }
        }
    }
}

This is a Jenkins bug, it is happening to me randomly too.
Also you should remove the > /workspace/script.sh.copy and JAVA_OPTS
that will confuse the people here.
It looks like the controller execute the step before the script file gets written to the agent machine.