There's probably nothing wrong with the sparsebundle image. The error message tells you that something is wrong with the context/environment that you're the command in.
From the man page for hdiutil:
"Device not configured. This error is returned explicitly by DiskImages when its kernel driver or framework helper cannot be contacted. It also often shows up when a device has been removed while I/O is still active. One common case of the helper not being found is when Foundation's Distributed Objects RPC mechanism cannot be configured. D.O. doesn't work under dead Mach bootstrap contexts such as can exist in a reattached screen(1) session. Root users can take advantage of StartupItemContext(8) (in /usr/libexec) to access the startup item Mach bootstrap context."
You'll need to ensure that you run the command from a session where the necessary support systems are available.
For example if you run the command inside a reattached screen session, this problem can occur (the word screen here is the name of a specific program).
So start by trying the command as an ordinary, logged in user on the physical machine using the GUI Terminal.app. Make sure you have administrative privileges (sudo) and get the command working.
Then afterwards you can try running it via ssh, via a launchd or whatever it is you're trying to accomplish.