Not seeing anything that jumps out at me. We do the exact same thing in our Xojo and Go apps. The only thing that we do is provide the path to hdiutil in Xojo ( /usr/bin/hdiutil ) but we don’t do that in the Go apps.
It’s probably something simple and stupid. I would create a small POC app. Perhaps your app is changing the contents in <app_path> while hdiutil is running?
in Unix/Linux a shell sometimes may lack enviroment/ export variables if startet out of context by any apps, esp. if sandboxed. Therefore always check and use full paths. check logfiles and or redirect messages (> textfile) to check the outputs.