tl;dr if you don’t know why an executeCommandLine isn’t working, log out what the command is returning.
Note, if this is JS Scripting and not Nashorn the code should be (complete with a duration so it returns the output of the command): JavaScript Scripting - Automation | openHAB
If the problem isn’t a permission problem, when you do not give executeCommandLine a Duration as the first argument, it returns before the command completes. I bet that the mkdir hasn’t completed when the cp command is run and therefore the folder doesn’t exist yet.