Can't mount dmg image as read/write

Disk images are just containers that emulate a disk. The DMG's contents are distinct from the DMG container. So you've probably only converted the container to read/write.

For example:

We can convert a DMG that contains an ISO to be read/write, but the ISO itself can only be read-only:

 ___________________        ___________________
|                   |      |                   |
|  Disk Image (r/o) |      |  Disk Image (r/w) |
|  _______________  |      |  _______________  |
| |               | |  ==> | |               | |
| | ISO9660 (r/o) | |      | | ISO9660 (r/o) | |
| |_______________| |      | |_______________| |
|___________________|      |___________________|

You run into a similar problem with the hybrid filesystem images that many OS distributions are shipping these days.

Here's an excerpt from the hdiutil(1) man page section on Hybrid images:

The generated image can later be burned using burn, or converted to another read-only format with convert.

The generated filesystem is not intended for conversion to read-write, but can safely have its files copied to a read/write filesystem by ditto(8) or asr(8) (in file-copy mode).

So there's the work-around: Copy the files off and make another DMG.

Which, unfortunately, is probably what you were hoping to avoid.

By the way, you might find this command helpful to peek into the DMG's partitions:

hdiutil pmap your_file.dmg

I found this in the Examples section of the hdiutil man page:

 Converting:
       hdiutil convert master.dmg -format UDTO -o master
             converts master.dmg to a CD-R export image named master.cdr
       hdiutil convert /dev/disk1 -format UDRW -o devimage
             converts the disk /dev/disk1 to a read/write device image file.  authopen(1) will be used
             if read access to /dev/rdisk1 is not available.  Note use of the block-special device.

Also, this piece looks like something you could use:

Using a shadow file to attach a read-only image read-write to modify it, then convert it back to a read-only image. This method eliminates the time/space required to convert a image to read-write before modifying it.

       hdiutil attach -owners on Moby.dmg -shadow
       /dev/disk2   Apple_partition_scheme
       /dev/disk2s1 Apple_partition_map
       /dev/disk2s2 Apple_HFS               /Volumes/Moby

       ditto /Applications/Preview.app /Volumes/Moby
       hdiutil detach /dev/disk2
       hdiutil convert -format UDZO Moby.dmg -shadow

I'm even wondering how the original convert worked, it seems like the arguments are in the wrong order, eg. the input file shoud be after the word convert.