I certainly know that feeling when I'm looking at the code repeatedly and it's not working. But there's an easy solution. The only thing to do is to set it aside till the next day. The solution is usually quite simple. It was there all the time.
rawpixels.net Oh, that's Lena.

When scanlines should be modulus and they aren't it can cause problems such as with ILBM which must be modulus 16. I discovered that the hard way.
I'm still not 100% sure about the image data format for the IMAG chunk but using an Image Decoder similar to Decode35 that returns chunky bytes for the index values is better because it gives more control for adding padding bytes for each scanline. Then we just use chunky to planar conversion with bitplane reduction for each scanline. Then copy the planar scanlines in sequence to the output buffer. The image data is only 2 or 3kb in size so just write it to the ILBM all at once after converting chunky to planar.
It's interesting that the key functions that do the most are the smallest as far as lines of code. They are less than 30 lines each for Decode35, MakePlanar & ChunkyBytesToBitplanes. I don't have a working sample yet but the pieces are all there to read an icon & save images.
As far as documentation for Glow Icons and ILBM file format there isn't much readily available. PeterK provided some information about the ARGB data chunks. I think I provided that in my zip archives that I posted here for you.
I had to learn many things about ILBM on my own with trial & error methods. The same is true for IFF Icon Data & Classic Icons. The standard documentation provides a good framework but for specific information we just need to have a good understanding of the file format.
Once I learn more about the format of the image data in the IMAG chunk of the IFF data I may write an addendum to Amiga Icon Format explaining the structure of the IMAG chunk and the ARGB chunk for others to read about.
Everyone should have access to this information. I should also put together a text document or PDF about the ILBM file format and how to write or modify picture datatypes.