When SoX writes a gsrt file, it checks for an odd number of samples and pads the file with a single 0x00 sample. This causes an audible click at the end of the file because the silence is represented by 0xff samples:
00007eb0: ffff ffff ffff ffff ffff ffff ffff ffff ................
00007ec0: ffff ffff ffff ffff ffff ffff ffff ff00 ................
Changing the padding byte from 0 to 0xff at gsrt.c line 161 eliminates the click.
https://sourceforge.net/p/sox/code/ci/master/tree/src/gsrt.c#l161
Fixed.