Your awk script is bad. Actually, the awk commands are OK, but where you are failing is in trying to make things "neat" using numfmt. Delete that junk that attempts to beautify the output, just display the raw numbers, and your script works much better:
Code:
find -type f -name \*\.\* -printf '%f\0%s\n' | gawk '
BEGIN {
FS = "\0";
}
{
split($1, a, ".");
ext = tolower(a[length(a)]);
files[ext] += 1;
size[ext] += $2;
}
END {
PROCINFO["sorted_in"] = "@ind_str_asc";
for (ext in files) {
print "*." ext " " files[ext] " files, " size[ext] " bytes";
}
}'