The MagickWand interface is a new high-level C API interface to ImageMagick core methods. We discourage the use of the core methods and encourage the use of this API instead. Post MagickWand questions, bug reports, and suggestions to this forum.
I went to your test page and my browser (Opera) thinks the Actual is 24-bit and the expected is 8-bit. So I downloaded the Actual and identify says it is 8-bit--same results as above. So then I downloaded the Expected and checked it
DirectClass means colors are defined directly in the array. You can thus have a different color for each individual pixel. for Grayscale each color is 8bit, and is quite economical.
PsuedoColor, means instead of an array of colors, it uses an array of color indexes into a table of colors. for 8 bit that means the image is limited to 256 colors! with eaith index also being 8bit, though the colors themselfs can be a 8 bit grayscale or a 24 bit RGB color. This is how GIF format works.
A 8 bit greyscale image may as well be DirectColor, for all the optimization savings a PsuedoColor indexed table of colors provides!
In IM you can set -type PsuedoColor (if this works depend of the output coder) or use PNG8:image.png, to use the special "PNG in a GIF-like format" coder.
Alternatively you can use external PNG specific programs to optimize the format without loss of quality ("optipng"), or quantize the colors into a 8bit color table ("pngng").