What version of ImageMagick are you using?The command to keep the color map does not seem to work.
It seems to have been implemented a long time ago, thought it could have been lost. However, I am not sure what it is supposed to do and under what conditions.
From the changelog at https://legacy.imagemagick.org/script/changelog.php
2011-04-18 6.6.9-6 Glenn Randers-Pehrson <glennrp@image...>
Added "-define PNG:preserve-colormap" option (reference viewtopic.php?f=3&t=18564).