When tklib::ico reads and writes *.ico, *.dll, *.exe files, it uses the code like ($w*$h+$h*($w%32)) in a number of places, to calculate extra padding required for AND mask. It turned out that the result for 24x24 icons is incorrent; when used with this size, tklib::ico may corrupt executable files and generate incorrect *.ico files (still accepted by some software, but e.g. icotool warns about the incorrect size and about garbage skipped).
If we regard $w==24 as a special case, ($w==24? 8 : $w % 32) is a correct replacement for the expression above. I'm attaching the patch fixing all places where the incorrect method was used.
Wish.ico has 24x24 members, and patched ico.tcl works fine with wish-based executables.