Fix vague/misleading error messages for non-existent color palettes

Fixes bug #20439.