But the keybox file didn't get any smaller:
Good catch. In gpg we have not implenteted the compression run:
https://lists.gnupg.org/pipermail/gnupg-users/2019-July/062398.html
814 /* FIXME: Do a compress run if needed and no other 815 user is currently using the keybox. */
https://git.gnupg.org/cgi-bin/gitweb.cgi?p=gnupg.git;a=blob;f=g10/keydb.c#l814